SWML
SWML is the JSON format that tells SignalWire how to handle calls. Your agent generates SWML automatically - you configure the agent, and it produces the right SWML.
What is SWML?
SWML (SignalWire Markup Language) is a document that instructs SignalWire how to handle a phone call. SWML can be written in JSON or YAML format - this guide uses JSON throughout. When a call comes in, SignalWire requests SWML from your agent, then executes the instructions.

SWML Document Structure
Every SWML document has this structure:
Key parts:
version: Always"1.0.0"sections: Contains named sections (usually justmain)- Each section is an array of verbs (instructions)
Common Verbs
A Complete SWML Example
Here’s what your agent generates:
The ai Verb in Detail
The ai verb is the heart of voice AI agents. Here’s what each part does:
prompt
The AI’s system prompt - its personality and instructions:
Or using POM (Prompt Object Model):
SWAIG
Defines functions the AI can call:
hints
Words that help speech recognition accuracy:
languages
Voice and language configuration:
params
AI behavior settings:
How Your Agent Generates SWML
You don’t write SWML by hand. Your agent configuration becomes SWML:
When SignalWire requests SWML, the agent’s _render_swml() method:
- Collects all configuration (prompts, languages, hints, params)
- Builds the SWAIG functions array with webhook URLs
- Assembles the complete SWML document
- Returns JSON to SignalWire
SWML Rendering Pipeline

Viewing Your SWML
You can see the SWML your agent generates:
SWML Schema Validation
The SDK validates SWML against the official schema:
- Located at
signalwire_agents/core/schema.json - Catches invalid configurations before sending to SignalWire
- Provides helpful error messages
Common SWML Patterns
Auto-Answer with AI
Record the Call
Transfer After AI
When a SWAIG function returns a transfer action, the SWML for transfer is embedded in the response:
Next Steps
Now that you understand SWML structure, let’s look at SWAIG - how AI calls your functions.