Assign a tool to an agent
assign a custom tool to an agent.
POST
https://api.centerfy.ai/webhooks/inbound/agents/:id/custom-tools Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | authenticates the request; or Authorization: Bearer <key>. |
Content-Type | Yes | application/json | request body is JSON. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | the agent id. |
Body parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
custom_tool_id | string | Yes | — | id of the custom tool to assign; must be a valid uuid and an existing custom tool (404 otherwise). |
enabled | boolean | No | — | whether the tool is enabled on the agent. Defaults to true; set to true unless exactly false. |
configuration | object | No | — | per-agent tool configuration (free-form object). Defaults to {} when omitted or not an object. |
Request body
{
"custom_tool_id": "<custom_tool_id>",
"enabled": true,
"configuration": {}
}Example
curl -X POST "https://api.centerfy.ai/webhooks/inbound/agents/{id}/custom-tools" \
-H "x-api-key: $CENTERFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"custom_tool_id": "<custom_tool_id>",
"enabled": true,
"configuration": {}
}' import { CenterfyClient } from "@centerfy/sdk";
const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });
const result = await centerfy.agents.assignCustomTool("<agentId>", {
"custom_tool_id": "<custom_tool_id>",
"enabled": true,
"configuration": {}
});
console.log(result); centerfy agents assign-custom-tool <agentId> '{"custom_tool_id":"<custom_tool_id>","enabled":true,"configuration":{}}' MCP tool: centerfy_agents_assign_custom_tool (see MCP server)
Response
{
"status": "success",
"assigned": true,
"assignment_id": "d3b2a1c0-1111-2222-3333-444455556666",
"agent_id": "<agent_id>",
"custom_tool_id": "<custom_tool_id>",
"enabled": true,
"order_index": 1
}Errors
400— for an invalid agent id or custom_tool_id.404— if the agent or the tool does not exist.500— on failure.
Notes
Assign-only and idempotent: if the tool is already assigned, returns 200 with already_assigned:true (and the existing assignment_id, enabled, and order_index); a fresh assignment returns 201. Use DELETE …/custom-tools/:toolId to remove.