ToolInvoker

Trait ToolInvoker 

Source
pub trait ToolInvoker: Send + Sync {
    // Required method
    fn invoke_tool(
        &self,
        tool_id: &str,
        parameters: HashMap<String, Value>,
    ) -> Result<Value>;
}
Expand description

Tool invocation capability for agents

This trait allows agents to invoke MCP tools with parameter validation and result handling.

Required Methods§

Source

fn invoke_tool( &self, tool_id: &str, parameters: HashMap<String, Value>, ) -> Result<Value>

Invoke a tool with the given parameters

§Arguments
  • tool_id - The ID of the tool to invoke
  • parameters - The parameters to pass to the tool
§Returns

The result of the tool invocation

Implementors§