Skip to Content

Tools

Let your agent call your own APIs mid-conversation — look up a policy, create a ticket, check a balance.

For calendar arithmetic, use the built-in Resolve date without an external API or secret.

An HTTP tool is a request to your API that the agent can make while it's talking. You define the shape once; the agent decides when to use it and fills in the parts that come from the conversation.

{
  "slug": "lookup_policy",
  "name": "Lookup policy",
  "method": "GET",
  "url": "https://crm.example.com/v1/policies/{policy_number}",
  "parameters": [
    {
      "name": "policy_number",
      "kind": "dynamic",
      "location": "path",
      "type": "string",
      "required": true,
      "description": "The policy number the caller provides."
    },
    {
      "name": "Authorization",
      "kind": "secret",
      "location": "header",
      "value": "crm_token",
      "prefix": "Bearer "
    }
  ],
  "response_map": {
    "policy_status": "$.status"
  },
  "timeout_ms": 4000,
  "retries": 1
}

Over the API: POST /v1/tools.

The slug is the name the agent sees, and it's permanent. The description on each parameter is how the agent knows what to put there, so write it for the agent, not for yourself.

Parameters

Each parameter says where its value comes from:

kindWhere the value comes from
dynamicThe agent, from the conversation
staticA fixed value you set
systemThe call itself — the call ID, the caller's number
secretA secret, decrypted at the moment of the call
slotA value captured earlier in this call

And location says where it goes: path, query, header, or body. If your URL or body already references the parameter in a template, we use your template as written instead of adding it again.

In a URL, only the path and query can be templated. The host is fixed, and private or internal addresses are rejected. Secrets belong in headers or bodies, never in URLs or agent-visible acknowledgements.

Getting values back out

response_map pulls fields out of the response and names them, so the rest of the call can use them:

{
  "response_map": {
    "policy_status": "$.status",
    "holder_name": "$.holder.name"
  }
}

Those become {{slots.policy_status}} and {{slots.holder_name}} — captured once and available to later tool requests and other fields that accept slots, so the value can be reused exactly. See Instructions & variables.

Hiding a value from the agent

Sometimes you need a value for the next request but the agent should never say it out loud. List it in internal_slots:

{
  "response_map": {
    "account_ref": "$.account.reference",
    "balance": "$.account.balance"
  },
  "internal_slots": [
    "account_ref"
  ]
}

The agent can tell the caller their balance and pass {{slots.account_ref}} to a payment tool, but it never sees the reference and can't read it aloud or put it in a summary.

This controls what the agent sees, not what's stored — the tool's own request and response still appear in the call's tool activity, subject to your PII redaction settings.

Settings worth knowing

SettingDefaultWhat it does
timeout_ms5000How long to wait. Keep it tight — the caller is listening
retries0Retry network failures and upstream 5xx. Never 4xx
modesyncasync runs it in the background and lets the agent carry on, with an optional line to say meanwhile
default_reactionspeaksWhether the agent talks while the call is in flight, or waits
carry_across_callsfalseOn a resumed call, reuse the last result instead of calling again. Leave off for live data

Running a tool before the agent speaks

Set phase: "pre_call" and the tool runs once, before the greeting, with no agent involvement — so the first thing the caller hears already knows who they are.

A pre-call tool can't take input from the agent: its parameters must be static, system, or secret. Its response_map values become {{tools.SLUG.NAME}}, usable in the prompt and the greeting.

On an inbound call, the caller is listening to silence while a pre-call tool runs; on an outbound call, this time passes while the line rings. Keep the timeout short.

When you attach it to an agent you also choose what happens if it fails — carry on with empty values, or end the call before anyone speaks.

Test it against the real thing

Supply values for the dynamic parameters and we run the real request:

{
  "params": {
    "policy_number": "P-4200"
  }
}

Over the API: POST /v1/tools/{id}/test.

This is a live request to your API, not a dry run. You get back the request we sent (with secrets masked), how long it took, and the response. An upstream 404 is returned as a response result. Check the URL and response before deciding the integration is working.

Attach tools to an agent

Add tool IDs to the agent's draft — in-call tools in behavior.tools.tool_ids, pre-call tools in behavior.tools.pre_call — then promote and deploy. See Transfers & call actions.

Up to 50 in-call tools and 10 pre-call tools per agent.

Changing and removing tools

Tool edits do not require a new agent promotion. Test a change before using it on live calls. A tool still attached to an active agent can't be archived; the error lists what's using it.

See also

MCP servers · Secrets · Instructions & variables

On this page