Disconnect a tool

SDK platic.agents.tools.disconnect()

Remove a tool from this agent by specifying its toolId in the URL. The change applies immediately, without publishing, and does not create a version. The tool remains in the workspace and on other agents. To delete it from all agents, delete its custom API or MCP server.

Example

await platic.agents.tools.disconnect("agent_123", "tool_123");

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓
toolIdstringTool id✓

Request body

No body.

Response

204 No Content, with no body.

Errors

Statusdetails.codeWhen
404AGENT_NOT_FOUNDThe agent doesn't exist or belongs to another workspace.
404TOOL_NOT_CONNECTEDThe tool isn't connected to this agent. details.toolId names it.

The format and codes for the rest of the API are in Errors.

Notes

  • A tool that no agent uses stays in the workspace. It can be connected again.
  • It is also how you remove a connection with toolExists: false, the one left when the tool was deleted from the workspace.
  • For the agent to stop using it without losing the connection, use Pause or resume a tool.
  • From an AI agent, the tool is disconnect_agent_tool.