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§
Sourcefn handle(&self, params: &Value) -> Result<Value, JsonRpcError>
fn handle(&self, params: &Value) -> Result<Value, JsonRpcError>
Handle a tool call with the given parameters
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Get the description of this tool
Sourcefn input_schema(&self) -> Value
fn input_schema(&self) -> Value
Get the JSON schema for this tool’s input parameters