Skip to main content
Client tools let an agent trigger actions in the connected application, such as opening a page or reading client-side state. They are available only over the WebSocket API. When the model invokes a client tool, Cartesia sends a client_tool_call event. Your application runs the function and, when required, responds with client_tool_result.

Define a client tool

Create the tool with POST /v1/agents/tools, then attach its ID through config.tools. See Tools for the shared execution settings.

Parameters

parameters must be a JSON Schema object. Properties may use string, integer, number, boolean, or an array of one of those scalar types. String properties may include an enum. Use required to identify values the model must supply.

Response behavior

  • expects_response: true makes the agent wait for a client_tool_result with the same tool_call_id. Use it when the result affects the conversation.
  • expects_response: false completes the tool after dispatch. Use it for client-side actions that the agent does not need to confirm.
response_timeout_secs is available only when expects_response is true.

Handle a tool call

Results are strings up to 4 KiB. On failure, send is_error: true with a short result that the model can act on. See the WebSocket event reference for complete event schemas.