Skip to main content
POST
/
v1
/
agents
/
{agent_id}
/
tools
Add Agent Tool
curl --request POST \
  --url https://api.xpander.ai/v1/agents/{agent_id}/tools \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "connection_id": "<string>",
  "operation_ids": [
    "<string>"
  ],
  "type": "action"
}
'
[
  {
    "id": "<string>",
    "name": "<string>",
    "connection_id": "<string>",
    "operation_id": "<string>",
    "operation_name": "<string>",
    "custom_function_id": "<string>",
    "mcp_id": "<string>",
    "allowed_tools": [
      "<string>"
    ],
    "target_id": "<string>"
  }
]
The request body is discriminated by type:
  • action{ "type": "action", "connection_id": "...", "operation_ids": ["<catalog id>"] }
  • custom_function{ "type": "custom_function", "custom_function_id": "..." }
  • mcp (registry) — { "type": "mcp", "mcp_id": "<registry id>" }
  • mcp (inline) — { "type": "mcp", "url": "https://...", "name": "...", "transport": "streamable-http" }
  • agent (sub-agent) — { "type": "agent", "agent_id": "..." }
  • workflow{ "type": "workflow", "workflow_id": "..." }

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Query Parameters

deploy
boolean
default:true

Deploy the agent after adding so the change takes effect immediately.

Body

application/json

Attach connector operations as agent tools.

connection_id
string
required

Connector connection id (the connection to call through).

operation_ids
string[]
required

Operation catalog ids — the id field from GET /tools/connectors/{connector_id}/operations.

type
string
default:action
Allowed value: "action"

Response

Successful Response

id
string
required

Stable handle for this attached tool. Pass it to DELETE to remove the tool.

type
enum<string>
required

The kind of attached tool.

Available options:
action,
custom_function,
mcp,
agent,
workflow
name
string | null

Human-readable tool name.

connection_id
string | null

Connector connection id. Actions only.

operation_id
string | null

Operation catalog id. Actions only.

operation_name
string | null

OpenAPI operationId. Actions only.

custom_function_id
string | null

Custom function id. Custom functions only.

mcp_id
string | null

MCP registry id. MCP only.

allowed_tools
string[] | null

Subset of MCP tools exposed. MCP only.

target_id
string | null

Referenced sub-agent or workflow id.