Skip to main content

ToolHandler

Trait ToolHandler 

Source
pub trait ToolHandler: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn call<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 CallContext,
        args: Value,
    ) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn name(&self) -> &str

Tool 이름 (MCP tool name과 매핑).

Source

fn description(&self) -> &str

Tool 한 줄 설명 (MCP description).

Source

fn call<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 CallContext, args: Value, ) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

핸들러 본체.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§