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, AppError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
Handler for an MCP tool.
Required Methods§
Sourcefn call<'life0, 'life1, 'async_trait>(
&'life0 self,
arguments: Option<Value>,
auth_token: Option<&'life1 str>,
ctx: McpRequestContext,
) -> Pin<Box<dyn Future<Output = Result<ToolsCallResult, AppError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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, AppError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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.