Short answer: give the agent its own number and subscribe it to that number's events. Dial gives AI agents real phone numbers: SMS, iMessage, WhatsApp, AI voice calls, and inbound events. When someone texts your agent's number, Dial emits a message.received event. When someone calls it, Dial's AI voice answers with the instructions you set for that number (or forwards the call to you), and emits call.ended and then call.transcribed when it's over. Your agent receives those events in whichever way suits it.
Step 1: Get the agent a number
Connect your agent to Dial in one of these ways:
https://getdial.ai/mcp as a custom connector in your assistant (Grok Bot, Claude Duet, ChatGPT dots, Meta Muse and Perplexity) or your MCP client, and sign in.curl -fsSL https://getdial.ai/install | bash, then dial auth login [email protected].Your first number comes with the account. It can receive texts and calls straight away.
Step 2: Decide what happens when someone calls
Inbound calls are answered for you. Each number has an inbound instruction: the system prompt the AI voice uses when someone calls in. The easiest way to set it is to ask your agent:
"Set your inbound instruction to: you answer for Sam's Plumbing. Get the caller's name, address and what's wrong, tell them someone will text within 15 minutes, and say goodbye."
Every setting below works the same way. Your agent changes it through Dial's tools, so you can ask in plain words from Grok Bot, ChatGPT, Claude or any other connected agent. From a terminal, it's one command:
dial number set +14155550123 \
--inbound-instruction "You answer for Sam's Plumbing. Get the caller's name, address and what's wrong, tell them someone will text within 15 minutes, and say goodbye."A few more switches you'll want (ask your agent, or use the commands):
--inbound-language es-ES. By default the voice picks the language from the caller's country code and also handles English.--forward-to +18005550100 rings that phone instead of the AI voice. Messages keep flowing to your agent.dial policy create --name "Customers" --all-numbers --allow +14155550199--calling off stops calls in both directions.Step 3: Choose how your agent hears about it
Same events, four ways to get them. Pick by how your agent runs.
| Your agent... | Use |
|---|---|
| Is doing one task and needs one answer ("wait for Dana's reply") | Wait once |
| Is an AI assistant in an app or chat (Grok Bot, Claude Duet, ChatGPT dots, Meta Muse, Perplexity) | Wait once while it's working; otherwise it reads new messages the next time you ask ("Any new texts?"). Webhooks are for teams running their own server |
| Runs on your machine and should wake up for every text or call | Listen service + local target |
| Is a server, or must never miss an event | Webhooks |
| Is your own long-running code | Event stream in the SDK |
Wait once. Blocks until a matching event arrives, then returns it:
dial wait-for message.received --field from=+14155550199 --timeout 60 --jsonOver MCP the same thing is the wait_for_event tool. Over REST it's POST /v1/events/wait (up to 60 seconds per request; loop it to wait longer).
Listen service. A small background service that records every event on your machine and can pass each one to your agent:
dial listen install
dial local-target add cmd /usr/local/bin/handle-dial-eventThe handler gets the event JSON and can start a fresh agent run with it. Dial's docs have ready-made handlers for Claude Code, OpenClaw and Hermes.
Webhooks. Dial POSTs each event to your HTTPS endpoint, signed, with at-least-once delivery and retries if your endpoint misses it:
curl -X POST https://api.getdial.ai/v1/webhooks \
-H "Authorization: Bearer $DIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "targetUrl": "https://example.com/dial/webhook", "eventTypes": ["message.received", "call.ended", "call.transcribed"] }'Verify the signature with the whsec_ secret you get back. You can limit a webhook to specific numbers with phoneNumberIds.
SDK event stream. In Node:
import { DialClient } from "@getdial/sdk";
const dial = new DialClient({ apiKey: process.env.DIAL_API_KEY! });
const conn = await dial.newEventsConnection();
for await (const event of conn) {
if (event.type === "message.received") {
console.log(`${event.data.from}: ${event.data.body}`);
}
}The live stream catches up on missed events only if it reconnects within about 2 minutes. When missing a message would matter, use a webhook.
Step 4: Act on what came in
A text: the event carries who sent it (from), which of your numbers got it (to) and the text (body). Photos, voice notes and shared contacts arrive as media items with a link you can open. Your agent replies with send_message, and the conversation continues on the same number. On iMessage and WhatsApp it can also answer in the thread or react to a message (reply_to_message).
A call: once call.transcribed arrives, fetch the call to read the transcript:
dial call get <call_id>Typical follow-ups: text the caller a booking link, add the request to your CRM, or ping you if the caller sounded urgent.
Example: an after-hours line in 10 minutes
- Set the number's inbound instruction to take a message: name, reason, best time to call back.
- Add a webhook for
call.transcribedandmessage.received. - In your handler, have the agent summarize each one and text you the summary. Anything marked urgent, it calls you instead.
You've just replaced voicemail with something that actually reads the messages.
Good to know
dial number set.FAQ
How can an AI agent receive SMS?
Give it a Dial (getdial.ai) number. Each incoming text becomes a message.received event that the agent can wait for (dial wait-for, or the wait_for_event MCP tool), stream with an SDK, or receive at a webhook.
How can an AI agent answer inbound calls?
Set the number's inbound instruction. Dial's AI voice answers every call with it, and the transcript is available when the call ends. Or forward calls to a person with --forward-to.
Does the agent have to be running when a text arrives?
Not with webhooks: Dial delivers to your endpoint at least once and retries if a delivery fails. With the local listen service, events are recorded on your machine and handed to your agent as they come in.
Can the agent receive photos and voice notes?
Yes. Attachments arrive as media items on the event, each with a URL you can open directly.
Can I block unknown callers?
Yes. Create an allow list and calls from anyone not on it are declined before they connect.
Does it work with WhatsApp and iMessage?
Yes. Messages to an iMessage number, or to a WhatsApp line, arrive as the same message.received events.
The takeaway
An agent that can only send is a notification system. Give it a number people can answer, and pick one way to hear back: a wait, a local listener, a webhook or a stream. Then it can hold the whole conversation.
