Skip to main content

How tools work

When a caller says something that matches a tool’s trigger (defined in its description field), the agent fires that tool automatically mid-conversation. The key thing to understand: tools are attached to LLM models, not to agents directly.
Agent  →  LLM Model  →  Tools
One LLM model can have multiple tools. Every agent that uses that model inherits all its tools automatically. To give an agent a new tool, update the LLM model it is linked to — not the agent itself. If you haven’t built an agent yet, start with the Quickstart first.

Tool types

TypeWhat the agent doesBest for
api_callCalls your HTTP endpointLookups, CRM updates, custom logic
transfer_callTransfers to a phone numberRouting to humans
extract_informationSaves structured data from the conversationCapturing name, email, budget
end_callHangs up the callCompleting a flow cleanly
send_smsSends a text messageFollow-ups, confirmations
send_emailSends an emailLead handoffs, summaries
schedule_calendar_eventBooks a calendar eventDemo scheduling, appointments

Step 1 — Create a tool

send_sms

Sends a text message to a fixed number when triggered. Use this to notify your team the moment a lead is captured, or to send a confirmation to the caller.
curl -X POST https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "notify_team_sms",
    "type": "send_sms",
    "description": "SMS the team when a lead is captured. Trigger when the caller shares their contact details.",
    "messaging_config": {
      "to": "+15555550000",
      "body_template": "New lead: {{name}} ({{phone}})"
    }
  }'
FieldWhat it does
descriptionHow the agent decides when to fire this tool — write it as a trigger condition
messaging_config.toDestination phone number in E.164 format (e.g. +15555550000)
messaging_config.body_templateMessage text. Use {{variable_name}} for dynamic values pulled from the conversation

send_email

Sends an email when triggered. Use this to deliver lead summaries to your sales team, send follow-up emails to callers, or notify someone when a key moment happens in a call.
curl -X POST https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "notify_team_email",
    "type": "send_email",
    "description": "Email the sales team when a lead is captured. Trigger when the caller expresses interest.",
    "messaging_config": {
      "to": "sales@example.com",
      "subject_template": "New lead: {{name}}",
      "body_template": "{{summary}}"
    }
  }'
FieldWhat it does
descriptionHow the agent decides when to fire this tool — write it as a trigger condition
messaging_config.toRecipient email address
messaging_config.subject_templateEmail subject line. Use {{variable_name}} for dynamic values
messaging_config.body_templateEmail body text. Use {{variable_name}} for dynamic values pulled from the conversation

schedule_calendar_event

Books a calendar event when triggered. Use this when you want the agent to schedule a demo or follow-up meeting directly during the call.
curl -X POST https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "book_demo",
    "type": "schedule_calendar_event",
    "description": "Book a product demo when the caller asks to schedule a meeting or demo. Trigger phrases: schedule, book a demo, set up a call.",
    "calendar_config": {
      "calendar_id": "primary",
      "duration_minutes": 30,
      "timezone": "America/New_York"
    }
  }'
FieldWhat it does
descriptionTrigger condition — tell the agent exactly when to fire this (e.g. “when the caller agrees to a meeting”)
calendar_config.calendar_idCalendar to book on. Use "primary" for the default calendar
calendar_config.duration_minutesLength of the event in minutes
calendar_config.timezoneIANA timezone string (e.g. "Asia/Tokyo", "Europe/London", "America/New_York")

api_call

Calls your own HTTP endpoint during the call. Use this to look up information (e.g. order status, account details), push data to your CRM, or trigger custom business logic based on what the caller says.
curl -X POST https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "check_inventory",
    "type": "api_call",
    "description": "Look up inventory by SKU when the caller asks about stock or availability.",
    "url": "https://api.example.com/inventory",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer <your_secret>"
    },
    "parameters": [
      {
        "name": "sku",
        "type": "string",
        "required": true,
        "description": "Product SKU the caller mentioned"
      }
    ],
    "run_in_background": true,
    "speak_during_execution": true
  }'
FieldWhat it does
urlYour endpoint URL — must be publicly reachable
methodHTTP method (GET, POST, PUT, PATCH)
headersAny auth headers your endpoint requires
parametersFields the agent extracts from the conversation and passes to your API as the request body
run_in_backgroundtrue = agent keeps talking while the API call runs in parallel. false = agent pauses and waits for the response
speak_during_executiontrue = agent says something like “Let me check that for you…” while the API call is in progress

transfer_call

Transfers the caller to a real phone number. Use this when the caller asks to speak with a human or needs to reach a specific team. The agent says a brief handoff message, then the call is transferred.
curl -X POST https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "transfer_to_human",
    "type": "transfer_call",
    "description": "Transfer to a human agent when the caller asks to speak to a person or escalate. Trigger phrases: talk to someone, speak to a human, I want a real person.",
    "transfer_to": "+15105550100"
  }'
FieldWhat it does
descriptionTrigger condition — be explicit so the agent knows exactly when to transfer
transfer_toThe phone number to transfer the call to, in E.164 format

extract_information

Silently captures structured data from the conversation as it happens — the agent doesn’t announce it to the caller. Use this to save lead qualification data, capture names and emails, or record key facts from the call.
curl -X POST https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "lead_capture",
    "type": "extract_information",
    "description": "Extract lead info from the conversation. Run this once the caller has shared their name and contact details.",
    "extraction_schema": {
      "fields": [
        {
          "name": "full_name",
          "type": "string",
          "required": true,
          "description": "Caller full name"
        },
        {
          "name": "email",
          "type": "string",
          "description": "Caller email address"
        },
        {
          "name": "interested",
          "type": "boolean",
          "description": "Whether the caller expressed interest"
        }
      ]
    }
  }'
FieldWhat it does
descriptionTells the agent when to run the extraction — not a phrase trigger, but a condition (e.g. “once the caller has answered the qualifying questions”)
extraction_schema.fieldsList of fields to extract. Each field has a name, type (string, boolean, number), optional required, and a description that guides the extraction
The captured data is available in the call record after the call ends.

end_call

Hangs up the call cleanly. Use this at the end of a flow — after a booking, after the caller says goodbye, or when the agent has completed its task. Without this tool, the call continues until the silence timeout is reached.
curl -X POST https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "hangup",
    "type": "end_call",
    "description": "End the call cleanly after the agent has completed its task or the caller says goodbye."
  }'

Step 2 — Attach tools to your LLM model

Creating a tool makes it available in your account, but the agent can’t use it yet. You need to attach it to the LLM model linked to your agent. Use the llm_id from your agent’s create response — this is the AI brain that decides what to do during a call.
curl -X PATCH https://api.oneinbox.ai/v1/models/<llm_id> \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "tool_ids": ["<tool_id_1>", "<tool_id_2>"]
  }'
Every agent linked to this llm_id picks up the change immediately — no restart required. To attach multiple tools, list all their IDs in the array.

Step 3 — Update your system prompt

The description on each tool is the trigger signal — it tells the agent when to fire the tool. But the system prompt gives the agent the context and instructions for how to use it in the flow. Be explicit about when and in what order tools should fire.
You are a helpful sales assistant for Acme Corp.

When the caller shares their name and email, use the lead_capture tool immediately.

After capturing their info, ask if they'd like to receive a follow-up SMS. If they say yes, use notify_team_sms.

If at any point the caller asks to speak to a human, use transfer_to_human.

Keep all replies under two sentences. Be warm and direct.

Reading tool results after a call

After the call ends, the extracted data and tool activity appear in the call record. Stop the call first, wait a few seconds, then fetch:
# 1. Stop the call
curl -X POST https://api.oneinbox.ai/v1/calls/<call_id>/stop \
  -H "Authorization: Bearer <api_key>"

# 2. Wait 2–3 seconds, then fetch
curl https://api.oneinbox.ai/v1/calls/<call_id> \
  -H "Authorization: Bearer <api_key>"
{
  "id": "call_abc123",
  "status": "completed",
  "messages": [
    { "role": "agent", "content": "Hi! How can I help?" },
    { "role": "user",  "content": "My name is Sama, my email is sama@acme.com" }
  ],
  "analysis": {
    "outcome": "Interested",
    "summary": "Caller expressed interest and shared contact details."
  }
}
messages and analysis are only available after the call ends — both are empty while the call is active.

Manage tools

List all tools

Retrieve every tool in your account. Useful for finding tool IDs when you need to attach or update them.
curl https://api.oneinbox.ai/v1/tools \
  -H "Authorization: Bearer <api_key>"

Update a tool

Change a tool’s name, description, or config. For example, update the trigger description to make the agent more (or less) sensitive to firing it.
curl -X PATCH https://api.oneinbox.ai/v1/tools/<tool_id> \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{ "description": "Updated trigger description" }'

Delete a tool

Remove a tool permanently. If the tool is attached to an LLM model, detach it first by PATCHing the model with an updated tool_ids array that excludes the deleted tool’s ID.
curl -X DELETE https://api.oneinbox.ai/v1/tools/<tool_id> \
  -H "Authorization: Bearer <api_key>"

API reference

Create tool · List tools · Update tool · Delete tool