Tools
Tools are managed throughclient.agents.tools because tool assignment is scoped to an agent or sub-agent. Use the persisted tool.id for durable operations and the model-facing tool.name when you want to address a tool by name.
Registering tools
Register a Python callable when the tool lives in your application code. The SDK derives the tool name, description, source, and argument schema from the callable:function_code may define a sync or async function:
Retrieving tools
Approval gates
Direct execution
Direct execution runs an already assigned tool. The REST API requiresconversation_id and message_id; SDK helpers mint IDs when omitted, but production integrations should pass stable IDs from their own message model. Pass an idempotency_key to reject duplicate in-flight submissions for side-effecting calls.
stream_raw() to receive the backend SSE event dictionaries instead of the SDK’s typed event projection:
Dry runs
Use dry runs to test source before registering it:Cached results
Tools with artifact-backed summarizers may return compact summaries with acache_id. Retrieve the full payload through the SDK while the cache entry is still valid:
Deleting and unassigning tools
Delete a tool when it should no longer be available to the agent:delete(...), matching the REST DELETE /agent/{agent_id}/tools/{tool_identifier} endpoint. Sub-agent assignment removal uses unassign_tool(...):

