pub trait ToolProvider: Send + Sync {
// Required methods
fn list_tools<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<Tool>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn call_tool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
arguments: Option<HashMap<String, Value>>,
ctx: &'life2 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ToolContent>, bool)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for implementing tool providers
Implement this trait to provide tools (functions, operations) to MCP clients. All methods receive a RequestContext with access to headers and request metadata.