McpToolHandler

Trait McpToolHandler 

Source
pub trait McpToolHandler: Send + Sync {
    // Required method
    fn call<'life0, 'life1, 'async_trait>(
        &'life0 self,
        arguments: Option<Value>,
        auth_token: Option<&'life1 str>,
        ctx: McpRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<ToolsCallResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Handler for an MCP tool.

Required Methods§

Source

fn call<'life0, 'life1, 'async_trait>( &'life0 self, arguments: Option<Value>, auth_token: Option<&'life1 str>, ctx: McpRequestContext, ) -> Pin<Box<dyn Future<Output = Result<ToolsCallResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute the tool.

auth_token is the token string (if provided by the client). Tools can use this for secondary checks (e.g., haptic permission) after the server validates token well-formedness/expiry.

Implementors§