Skip to main content

call_tool

Function call_tool 

Source
pub async fn call_tool(
    ctx: AgentContext,
    name: &str,
    args: AgentValue,
) -> Result<AgentValue, AgentError>
Expand description

Invokes a tool by name with the given arguments.

§Arguments

  • ctx - The agent context for the invocation
  • name - The name of the tool to call
  • args - Arguments to pass to the tool

§Returns

The tool’s result, or an error if the tool is not found or fails.