Local tools
UseTool::new(...) when the Rust process can execute the operation:
serde_json::Value; validate untrusted arguments inside the executor when stronger runtime guarantees are required.
Approval-gated tools
Addrequire_approval() to pause before execution:
run.status == "waiting_for_human" and run.pause.kind == "tool_approval".
Resume by exact call ID:
0.1 API does not expose a separate rejection type. Leave an unapproved call paused or apply your application’s rejection policy before resuming.
External tools
UseTool::external(...) when another process performs the operation:
external_output when every pending call needs an external result. Supply each result by call ID:
Tool errors
AnAgentError returned by a local executor becomes a structured tool error message and is sent back to the model. An unknown tool name or a missing approval/output fails continuation with AgentError.