Using Dial from an agent
Dial is built for AI agents. There are a few ways to wire it in, and you can mix them in the same project.
CLI shell-out
If your agent can run shell commands (for example, a coding agent), call the dial CLI. Every command accepts --json, so the agent gets structured output it can parse instead of prose.
Why this works well for agents:
--jsonon every command — machine-readable results, no scraping.- Stable exit codes — non-zero means failure, so the agent can branch on success.
- Blocking waits —
dial wait-for <event-type>blocks until a matching event arrives (see Receive an SMS). - Background capture — the listen service records events to a local log the agent can tail.
In-process SDK
If your agent is written in code, import an SDK and call it directly.
Remote MCP
If your agent speaks the Model Context Protocol, it can skip the CLI and the SDK entirely. Point it at Dial’s Remote MCP server at https://getdial.ai/mcp and authorize once in the browser — no API key handling, no local install. The agent then calls Dial’s capabilities as MCP tools (send_message, place_call, wait_for_event, …) that mirror the CLI commands.
Which should I use?
On a machine that already has the CLI, dial mcp also exposes every command as a local MCP server (stdio, reusing the saved key) — see MCP. It’s the same tool surface as the Remote MCP plus enhanced inbound capabilities (a persistent listener, local event fan-out) and onboarding.
All of these call the same REST API and use the same API key.