Tools and MCP servers
Tools belong to an agent’s draft. Every tool write takes the draft ETag in If-Match and a new
Idempotency-Key, like any other draft edit (Build and publish an agent). A tool
takes effect for calls once the agent is published.
Add a webhook tool
-
A secret header pins one exact
{secret_id, version}. Rotation never moves a pin: to adopt a new version, replace the tool with the new reference and publish. See Secrets and rotation. -
For one-off setup you may send write-only material instead of a reference:
"credential": {"value": "…", "material_kind": "api_key"}. It is sealed at once as version 1 of a new secret and reads back only as its reference. Inline material needs thesecrets.managecapability; a reference needssecrets.read. -
end_call,transferandtransfer_to_numberare reserved names, and so is the prefix_detached_: every write and validation refuses them withinvalid_request(details.field = "name"). Configure the built-in tools through the draft’sdefault_tools(the default-tool policy). -
A pinned version must be releasable when you bind it: a revoked or destroyed version, a secret of another workspace, or a secret of the other purpose answers
credential_unavailable. -
A tool’s name is its key in the draft: a second tool with the same name answers
409 tool_name_conflict. -
A destination that names a private address (
127.0.0.1,localhost,*.internal) answers422 outbound_destination_refused.
Validate, replace and remove
DELETE detaches the tool from the draft and answers the draft. A version that already froze the
tool keeps running it until another version is activated. Disabling a live tool immediately is done
in the app; to stop its credential at once, revoke the secret version
(POST /secrets/{secret_id}/versions/{version}/revoke).
Register an MCP server and discover its tools
An MCP server is a workspace-level tool source that several agents can use.
-
urlis an absolute HTTPS URL with no credentials, query or fragment; anything else answers400 invalid_requestwithdetails.field = "url". -
auth: nonecarries no credential and no header name;bearerneeds a credential;secret_headerneeds a credential andheader_name. -
The credential is a secret whose
purposeismcp_server, or inline material, which is sealed as one. Awebhook_toolsecret is refused withcredential_unavailable: store the MCP token as its own secret even when it has the same value as a webhook secret. -
A disabled server answers
404 not_foundon reads and updates. -
Discovery contacts the server under the platform’s egress policy and saves the bounded tool list. A server that does not answer gives
"state": "failed"with a registeredfailurereason (never the remote text), and the last good discovery stays. Discovering the same tool set again changes no ETag. A host name that cannot be resolved is refused withoutbound_destination_refusedrather than recorded as a failed discovery. -
The same discovery request with the same
Idempotency-Key, sent while a discovery still runs, answers409 idempotency_in_progresswithRetry-Afterand does not contact the server; afterRetry-Afterit replays the result. A refused discovery (outbound_destination_refused,credential_unavailable) keeps nothing, so the identical request can be sent again at once. -
A running discovery holds its
Idempotency-Keyfor up to two minutes, soRetry-Afteron a duplicate can be as long as 120 seconds. -
Before a discovery saves its result, it is admitted again. If the key was revoked or the workspace suspended while it ran, it answers
401 unauthenticatedor409 workspace_unavailableand saves nothing. A discovery whose claim a retry took over also saves nothing: it answers409 idempotency_in_progresswhile the new attempt runs, or replays that attempt’s answer once it has settled.
Attach a discovered tool
Attach a discovered tool to a draft with "kind": "mcp" and
"definition": {"server_id", "remote_tool_name", "schema_digest"}, taken from the discovered list.
The tool’s name must equal the remote name. The tool copies the server’s pinned credential version,
so a server whose pinned version is revoked cannot have tools attached (credential_unavailable).
Change an MCP server
PUT /mcp-servers/{server_id}needs the server’s own ETag inIf-Match.- An omitted credential keeps its binding only when
authandheader_nameare unchanged. - Discovery resets only when the URL, transport, auth mode or header name changes, so adopting a rotated credential keeps it.
- Changing a server changes it in every draft that attached tools of it: those tools take its new URL, authentication and credential version at once, so the draft ETag of each of those agents changes. Each agent adopts the change when you publish it.
- A different
resource_keyanswers409 conflictwithdetails.reason = "resource_key_immutable"; omitting it keeps the stored key.
Disable an MCP server
DELETE /mcp-servers/{server_id} takes the server’s current ETag and an idempotency key.
It soft-disables the source and removes it from ordinary discovery and authoring reads.
The source keeps its resource_key; creating another with that key still conflicts.
See the API Reference for disable eligibility and response details.
Credentials during calls
A webhook tool or MCP server sends the exact secret version it pins, and the platform checks that version every time it releases it.
- Webhook tools. Each call to the tool releases the pinned version. A revoked or destroyed
version is refused at once, also in live agents and running calls: the tool call shows as a
refused tool outcome with
credential_unavailable, and the call continues. - MCP servers. Before every tool call on an MCP server, the platform asks for the pinned version
again. If the version is revoked, or the platform cannot confirm it in time (for example during a
platform outage), the connection stops using the credential for the rest of the call: that tool
call and every later one to the same server in the call end with
credential_unavailable. The check fails closed. It shares the tool call’s deadline; with no time left, nothing is sent and the tool call fails with its deadline reason. The connection itself closes when the call ends. - An action that was already sent is not undone.
See Secrets and rotation for revoking a version.