call_tool_with_args

Function call_tool_with_args 

Source
pub async fn call_tool_with_args<T: Serialize>(
    collection: &ToolCollection,
    name: &str,
    args: &T,
) -> Result<Value, ToolError>
Expand description

Call a tool by name with typed arguments on a given collection.

ยงExample

use tools_rs::{collect_tools, call_tool_with_args};

let tools = collect_tools();
let result = call_tool_with_args(&tools, "add", &[1, 2]).await?;