call_tool

Function call_tool 

Source
pub async fn call_tool(
    name: &str,
    arguments: Value,
) -> Result<FunctionResponse, ToolError>
Expand description

Call a tool by name with JSON arguments.

This is a convenience function that combines tool collection and execution in a single call. Useful for simple scenarios where you don’t need to manage the tool collection yourself.

§Arguments

  • name - The name of the tool to call
  • arguments - JSON value containing the arguments

§Example

use tools_rs::call_tool;
use serde_json::json;

let result = call_tool("add", json!({"a": 1, "b": 2})).await?;