Add tools
Tools let the LLM act mid-call. For the four kinds and the parameter schema, see Tools.
System built-in
Add a built-in directly to the agent with kind: "builtin". config.builtin must be one of the capabilities from GET /v1/agents/tool-capabilities; name is the identifier the LLM calls.
The LLM calls end_call() and the room disconnects immediately.
transfer_to_number and play_keypad_touch_tone are SIP-dependent and return a clear error until phone-number support is enabled on your account.
Webhook tool
Create the tool. The worker signs a JSON envelope, POSTs it to your URL, and returns your response to the LLM.
The create response includes the HMAC signing secret once ("webhook_secret": "wh_sec_…"). Store it now - every later read returns a masked placeholder, and there is no retrieval endpoint.
Your endpoint receives a JSON envelope and replies 200 OK with JSON, which the agent uses as the tool’s return value:
Verify the webhook signature
Each call carries a single combined signature header (Stripe/ElevenLabs format):
t is the dispatch time in Unix seconds and v0 = HEX(HMAC_SHA256(secret, "<t>.<raw body>")) - sign over the t value, a literal ., then the raw body.
Reject deliveries whose t is more than 5 minutes old to guard against replays. For method: "GET", arguments are sent as query parameters and the signature covers an envelope that isn’t on the wire - use POST for any endpoint you plan to verify.
Client tool
Runs in the caller’s browser or SDK over the session’s tools data channel.
Your client receives a tool_call and replies with a tool_response carrying the same tool_call_id on the same channel:
The @speechify/agents-js SDK will wrap this with a single registerTool(name, handler) call - the reference will be linked here when it publishes.
MCP tool
A customer-hosted Model Context Protocol server. Create the tool with POST /v1/agents/tool-definitions using an MCPToolConfig body - pick a transport (http_streamable or sse) and an auth mode (none, bearer, or oauth2_client_credentials). The worker opens the configured transport at session start, discovers the remote server’s tool list, and proxies tool calls through.
See Tools for the configuration model and the API Reference for the full MCPToolConfig schema.
Attach to an agent
A webhook or client tool must be attached before the LLM can call it.