LLM function tools
How to define tools.llm_tools for voice agents — schema, validation, and examples
Voice agents can call external HTTP APIs during a conversation. Tools are sent as JSON on create/update:
On PATCH, sending tools replaces the entire llm_tools array. Always GET the agent first, edit the list, then PATCH.
Tool object shape
Each item in llm_tools has three parts:
function (LLM-facing)
Parameter types (parameters.properties)
Each parameter is an object with type and description (description max 1024 chars). Parameter names cannot contain spaces (max 128 chars).
Use parameters.required for mandatory argument names (each must exist in properties).
api_details (HTTP call)
Placeholders in the URL must match parameter names. Example: parameter order_id → https://api.example.com/orders/{{order_id}}.
Hold message and result reuse
Both settings go in api_details and can be left out to use the defaults.
speak_hold_message(defaulttrue): before the tool runs, the agent says a short hold line such as “One moment” so the caller isn’t left in silence. Set it tofalsefor quick tools, or when the agent already tells the caller what it is doing.cache_within_call(defaulttrueforGET,falseotherwise): if the tool is called again in the same call with the same arguments, the agent reuses the earlier result instead of calling your API again, which saves the wait. Only successful results are reused, and the saved results are cleared as soon as any tool runs without reuse, so a lookup after a create or update always gets fresh data. Turn it on for read-only tools sent asPOST; keep it off for tools that change data (create, apply, update) or return something new on every call.
Example 1 — GET with query placeholder
Look up an order when the caller gives an order ID:
Example 2 — POST with payload template
Schedule a callback with two arguments:
Example 3 — Multiple tools on one agent
Common validation errors
Testing tools
Use a request inspector such as https://httpbin.org while developing: GET https://httpbin.org/get?order_id={{order_id}} or POST https://httpbin.org/post with a payload_template. Replace with your production URL before going live.
Related docs
- Language Options · Voice Options
- Core Concepts — Voice and runtime settings
- Agents API reference —
POST /api/agent,PATCH /api/agent/{id}

