Skip to main content

execute_single_tool

Function execute_single_tool 

Source
pub async fn execute_single_tool(
    tool: Option<&dyn Tool>,
    call: &ToolCall,
    state: &Value,
) -> ToolExecution
Expand description

Execute a single tool call.

This function:

  1. Creates a Context from the state snapshot
  2. Executes the tool
  3. Extracts any state changes as a TrackedPatch

ยงArguments

  • tool - The tool to execute (or None if not found)
  • call - The tool call with id, name, and arguments
  • state - The current state snapshot (read-only)