Skip to main content

TaskToolHandler

Trait TaskToolHandler 

Source
pub trait TaskToolHandler: Send + Sync {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        arguments: HashMap<String, Value>,
        context: TaskContext,
    ) -> Pin<Box<dyn Future<Output = McpResult<ToolResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Application handler for a tool that executes as a durable MCP task.

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, arguments: HashMap<String, Value>, context: TaskContext, ) -> Pin<Box<dyn Future<Output = McpResult<ToolResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, Fut> TaskToolHandler for F
where F: Fn(HashMap<String, Value>, TaskContext) -> Fut + Send + Sync, Fut: Future<Output = McpResult<ToolResult>> + Send,