Bind tools of a Connection to an Agent
POST /v1/tool-bindings
| Property | Value |
|---|---|
| Operation | create_tool_binding |
| Group | Tool bindings |
| Scope | integrations:write |
| Route class | control |
| Idempotency | Idempotency-Key accepted: a retry with the same key replays the first answer |
| Audit | Audited integrations.tool_binding.create (mutation) |
| Released in | 1.60.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Creates a binding at revision 1 (1.60.0): each tool with its model-facing name, constraints, projection, deadline and flag, its upstream contract digest pinned from the Connector's manifest or the registration's accepted pin. Every issue is a detail of validation_failed (ToolBindingIssueCode); a revoked Connection is connection_revoked; a send tool is refused with capability_not_available until the consent check of roadmap slice 2.15 exists.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the integrations:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X POST "$VOCAL_API/v1/tool-bindings" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_...",
"connection_id": "con_...",
"tools": [
{
"tool": "<tool>"
}
]
}'const response = await fetch(`${process.env.VOCAL_API}/v1/tool-bindings`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"agent_id": "agt_...",
"connection_id": "con_...",
"tools": [
{
"tool": "<tool>"
}
]
}),
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/tool-bindings",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"agent_id": "agt_...",
"connection_id": "con_...",
"tools": [
{
"tool": "<tool>",
},
],
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
idempotency-key | header | string | no | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Request body
Content type application/json, required: ToolBindingCreateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | AgentId | yes | |
connection_id | ConnectionId | yes | |
tools | array of ToolBindingToolInput | yes |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
201 | application/json | ToolBinding | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
409 | application/json | ErrorEnvelope | connection_revoked, idempotency_in_progress, idempotency_key_reused |
422 | application/json | ErrorEnvelope | validation_failed, capability_not_available |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 201 answer
The shape is ToolBinding.
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | AgentId | yes | |
binding_sha256 | Sha256Hex | yes | The digest of the canonical binding (toolBindingSha256Source), which a frozen copy and a grant name. |
connection_id | ConnectionId | yes | |
connector_id | ConnectorId or null | yes | |
connector_version | string or null | yes | The manifest version the tools were pinned from; null for an MCP server. |
created_at | Timestamp | yes | |
id | ToolBindingId | yes | |
mcp_server_id | McpServerId or null | yes | |
object | "tool_binding" | yes | |
organization_id | OrganizationId | yes | |
origin | ConnectionOrigin | yes | |
revision | integer | yes | |
tools | array of ToolBindingTool | yes | |
updated_at | Timestamp | yes |