add_agent_tool
Add or update one or more HTTP API tools on a single-prompt agent, enabling it to make external requests (e.g., look up orders, post to CRM) during calls. Tools upsert by name.
Instructions
Add (or update) one or more API-call tools on a single_prompt agent. API-call tools let the agent make an HTTP request to an external API during a call — e.g. look up an order, book an appointment, or post to a CRM. The agent decides when to invoke a tool based on its name and description, filling in any declared parameters. Pass a single tool via the top-level fields, or several at once via tools (preferred when configuring multiple tools — they land in one draft write). Upserts by name: tools with existing names are replaced; others are added (existing tools are preserved). For versioned agents the change is saved as a draft — pass draft_id to stack onto an existing draft (e.g. one returned by update_agent_prompt or set_pre_call_api) instead of creating a new one, then publish_draft once. Caveat: the draft's tools section is written wholesale, so when targeting a draft that already had tool edits, include ALL desired tools in this call. Use get_agent_prompt to see an agent's current live tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | The agent ID to add the tool(s) to | |
| draft_id | No | Existing draft to write into (stacks this change onto the draft's other edits). Omit to create a new draft from the live version. | |
| tools | No | Batch mode: multiple API-call tools to add/update in one write. When provided, the top-level single-tool fields are ignored. | |
| name | No | Unique tool name, no spaces (e.g. lookup_order). Re-using a name replaces that tool. | |
| description | No | What the tool does and when the agent should call it. This is the only guidance the LLM gets — be specific. | |
| url | No | The endpoint URL to call. May contain {{variable}} placeholders. | |
| method | No | HTTP method | |
| timeout_ms | No | ||
| headers | No | ||
| query_params | No | ||
| request_body | No | ||
| parameters | No | ||
| response_variables | No | ||
| enabled | No |