ToolHandler

Trait ToolHandler 

Source
pub trait ToolHandler: Send + Sync {
    // Required methods
    fn handle(&self, params: &Value) -> Result<Value, JsonRpcError>;
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn input_schema(&self) -> Value;
}
Expand description

Trait for MCP tools

Required Methods§

Source

fn handle(&self, params: &Value) -> Result<Value, JsonRpcError>

Handle a tool call with the given parameters

Source

fn name(&self) -> &'static str

Get the name of this tool

Source

fn description(&self) -> &'static str

Get the description of this tool

Source

fn input_schema(&self) -> Value

Get the JSON schema for this tool’s input parameters

Implementors§