Overview
The Tools API allows you to register custom tools that agents can use during execution. Tools can run locally or in the sandboxed environment.Tool Registration
register_tool
Callable
required
The function to register as a tool
bool
default:"True"
Whether the tool should execute inside the sandbox
Tool Execution
execute_tool
str
required
Name of the tool to execute
AgentState | None
Agent state if the tool requires it
Any
Tool-specific arguments
Any
Tool execution result
execute_tool_with_validation
str | None
required
Name of the tool to execute
AgentState | None
Agent state if required
Any
Tool arguments
Any
Tool result or error message
process_tool_invocations
list[dict[str, Any]]
required
List of tool invocation dictionaries
list[dict[str, Any]]
required
Conversation history to append results to
AgentState | None
Agent state
bool
True if agent should finish execution
Tool Registry
get_tool_by_name
str
required
Tool name
Callable[..., Any] | None
Tool function or None if not found
get_tool_names
list[str]
List of tool names
needs_agent_state
str
required
Name of the tool
bool
True if tool needs agent_state