Skip to main content

Tool

Trait Tool 

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

    // Provided method
    fn input_schema(&self) -> Value { ... }
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn description(&self) -> &'static str

Source

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

Provided Methods§

Source

fn input_schema(&self) -> Value

JSON Schema for the tool’s arguments object.

Implementors§