Skip to main content
PATCH
/
api
/
v1
/
agent
/
{agent_id}
/
tools
/
{tool_identifier}
Update Tool
curl --request PATCH \
  --url https://api.example.com/api/v1/agent/{agent_id}/tools/{tool_identifier}
Update a tool assigned to an agent. tool_identifier may be the persisted tool ID or tool name. Updates are durable and create a new version of the tool definition used by future executions. Tool schema, metadata, approval settings, credentials, and source code changes invalidate cached tool definitions for affected agents.

Path Parameters

ParameterTypeDescription
agent_idstringThe agent’s unique identifier
tool_identifierstringThe tool’s persisted ID or name

Request Body

Send only the fields you want to change.
{
  "description": "Execute an approved read-only analytics query.",
  "function_code": "async def query_database(sql: str, limit: int = 100) -> dict:\n    return {'rows': [], 'limit': limit}",
  "args_schema": {
    "type": "object",
    "properties": {
      "sql": { "type": "string" },
      "limit": { "type": "integer" }
    },
    "required": ["sql"]
  },
  "execution_timeout": 45
}
function_code may define a sync or async Python function.

Response

Returns the updated tool definition, including the stable tool ID and current version metadata.