The Send SMS function (type: "send_sms") sends a text message to the caller while the call is in progress. Use it for booking links, confirmations, addresses, or to collect details that are hard to say out loud, such as email addresses and reference numbers. Needs keys Real delivery needs a Telnyx key. Without one, the mock SMS provider records the message and nothing is sent.
Message types#
sms_content has three shapes. The dashboard shows them under Message as Static, Prompt and Collect details.
| UI | Shape | What is sent |
|---|---|---|
| Static | { "type": "predefined", "content": "..." } |
The text as written, with {{variables}} rendered |
| Prompt | { "type": "inferred", "prompt": "..." } |
Text the LLM writes. Your prompt becomes the description of a content argument on the tool |
| Collect details | { "type": "info_collection", "intro": "...", "fields": [ ... ] } |
Your intro plus a request to reply with each field. The reply is read into variables |
Collect details#
Collect details texts the caller a short form. The message is the intro (rendered with variables) followed by "Please reply to this message with your A, B and C." where A, B and C are each field's description (or its name when there is no description).
When the caller texts back, the API extracts the fields from the reply and adds them to the call's collected dynamic variables. Extraction uses the LLM, or a heuristic in mock mode. Fields use the same shape as post-call analysis fields:
| Field | Type | Description |
|---|---|---|
type |
"string", "enum", "boolean", "number" |
Shown as Text, Selector, Boolean, Number |
name |
string | Variable name. Spaces become underscores |
description |
string | Used in the message and for extraction |
choices |
string array | For enum |
At least one field must have a name before Save is enabled.
{
"type": "send_sms",
"name": "collect_email",
"description": "Text the caller to collect their email address when they want an emailed quote.",
"sms_content": {
"type": "info_collection",
"intro": "Hi, it's Ava from {{business_name}}.",
"fields": [
{ "type": "string", "name": "email", "description": "email address" },
{ "type": "string", "name": "unit_number", "description": "unit number" }
]
}
}Configure in the dashboard#
- Open the agent, expand Functions, click Add and choose Send SMS.
- Set Name and Description. The default description is "Send the caller an SMS."
- Pick Static, Prompt or Collect details under Message and fill it in.
- Optional: Speak during execution, Typing sound, Speak after execution.
- Click Save.
Sender and recipient#
- From: the agent's number on this call (the number dialled for inbound calls, the calling number for outbound).
- To: the user's number on this call.
Both numbers must exist, so SMS only works on phone calls. On a web call the tool returns an error. The number must be able to send SMS with your carrier.
Result#
| Outcome | Text the LLM gets |
|---|---|
| Sent | SMS sent: <content> |
| Failed | Error: SMS could not be sent (<reason>) |
The LLM replies after this tool unless Speak after execution is off. A sent message is recorded as an sms item in transcript_with_tool_calls, with the content and the recipient.
In conversation flows#
Use the Send SMS node (palette label In-Call SMS) to send at a fixed step with SMS sent and SMS failed edges. See SMS node.
Gotchas#
- For Prompt messages, tell the LLM what the message must contain and how long it may be. It writes the content as a tool argument.
- Collect details fills variables when the reply arrives. If the call has already moved on, use the values in a later turn or in post-call workflows.