> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # SwmlTransferSkill > Transfer calls between agents/endpoints based on pattern matching. [add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill Transfer calls between agents or endpoints using SWML transfer actions. The skill accepts either a **Python-style `transfers`** config (regex pattern → per-entry config) or a **TypeScript-style `patterns`** array of named destinations. At least one of the two shapes is required — `setup()` fails closed otherwise. **Class:** `SwmlTransferSkill` **Tools:** `transfer_call` always; `list_transfer_destinations` additionally registered when at least one entry is supplied in `patterns`. **Env vars:** None **Multi-instance:** yes — set a distinct `tool_name` per instance. **`transfers`** `Record` Python-style map of transfer configs keyed by regex pattern (or name). Each entry includes either `url` or `address` (not both), plus optional `message`, `return_message`, `post_process`, `final`, and `from_addr`. Either `transfers` or `patterns` must be provided; both may be combined. `setup()` fails closed when neither is configured. --- **`patterns`** `TransferPattern[]` TypeScript-style array of named transfer patterns. Each object has: * `name` (string, required) — friendly name for the destination. * `destination` (string, required) — SIP URI, phone number, or agent URL. * `description` (string) — optional human-readable description. * `message` / `returnMessage` / `postProcess` / `final` / `fromAddr` — optional per-pattern overrides. --- **`allow_arbitrary`** `boolean` Whether to allow transfers to arbitrary destinations not listed in `patterns` / `transfers`. When unset, defaults depend on whether any patterns are configured. --- **`tool_name`** `string` — default: transfer\_call Name of the transfer tool exposed to the AI. --- **`description`** `string` — default: Transfer call based on pattern matching Description for the transfer tool shown to the AI. --- **`parameter_name`** `string` — default: transfer\_type Name of the parameter that accepts the transfer type. --- **`parameter_description`** `string` — default: The type of transfer to perform Description for the transfer-type parameter. --- **`default_message`** `string` — default: Please specify a valid transfer type. Message spoken when no pattern matches. --- **`default_post_process`** `boolean` — default: false Whether to post-process the default message with the AI. --- **`required_fields`** `Record` — default: \{} Map of additional fields (name → description) the agent must collect before a transfer. --- > **Note** > > Regex patterns in `transfers` are matched **case-sensitively**. Use character > classes or flags in the source pattern when case-insensitive matching is > needed. ## Example — TypeScript patterns ```typescript {6-20} import { AgentBase, SwmlTransferSkill } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'assistant', route: '/assistant' }); agent.setPromptText('You are a helpful assistant.'); await agent.addSkill(new SwmlTransferSkill({ patterns: [ { name: 'sales', destination: 'https://your-server.com/sales-agent', description: 'Sales team', }, { name: 'support', destination: '+15551234567', description: 'Technical support line', }, ], default_message: 'Please specify sales or support.', })); agent.run(); ``` ## Example — Python-style transfers ```typescript {6-14} import { AgentBase, SwmlTransferSkill } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'assistant', route: '/assistant' }); agent.setPromptText('You are a helpful assistant.'); await agent.addSkill(new SwmlTransferSkill({ transfers: { '^sales$': { address: 'sip:sales@signalwire.com' }, '^support$': { url: 'https://your-server.com/support-agent' }, }, })); agent.run(); ``` > Transfer calls between agents/endpoints based on pattern matching.