@@ -231,13 +231,18 @@ def _load_call(cls, data: dict[str, Any]) -> ClientToolCall:
231231class ToolConfirmationCall (ActionCall ):
232232 """A tool confirmation request from the agent.
233233
234+ Some tools require explicit user confirmation before execution, to prevent unintended or destructive actions.
235+ These tools include Call Function, Run Python code, and Call REST API.
236+ When an agent wants to run one of these tools, this action is included in the response
237+ instead of the final result. Respond with a :class:`ToolConfirmationResult` using ``status="ALLOW"`` to proceed or ``status="DENY"`` to cancel.
238+
234239 Args:
235240 action_id (str): The unique identifier for this action call.
236- content (MessageContent): The confirmation message content .
241+ content (MessageContent): The human-readable confirmation message from the agent .
237242 tool_name (str): The name of the tool requiring confirmation.
238243 tool_arguments (dict[str, object]): The arguments for the tool call.
239244 tool_description (str): Description of what the tool does.
240- tool_type (str): The type of tool (e.g., "runPythonCode", "callRestApi").
245+ tool_type (str): The type of tool (e.g., "callFunction", " runPythonCode", "callRestApi").
241246 details (dict[str, object] | None): Optional additional details about the tool call.
242247 """
243248
@@ -403,10 +408,14 @@ def _load(cls, data: dict[str, Any]) -> ClientToolResult:
403408
404409@dataclass (frozen = True , slots = True )
405410class ToolConfirmationResult (ActionResult ):
406- """Result of a tool confirmation request.
411+ """Result of a tool confirmation request, sent back to the agent.
412+
413+ Use this to respond to a :class:`ToolConfirmationCall` received in the agent response.
414+ Pass ``status="ALLOW"`` to let the agent execute the tool, or ``status="DENY"`` to cancel it.
415+ Always include the ``cursor`` from the confirmation response when sending this result.
407416
408417 Args:
409- action_id (str): The ID of the action being responded to.
418+ action_id (str): The ID of the :class:`ToolConfirmationCall` being responded to.
410419 status (Literal['ALLOW', 'DENY']): Whether to allow or deny the tool execution.
411420 """
412421
0 commit comments