Tool

Trait Tool 

Source
pub trait Tool {
    // Required methods
    fn name(&self) -> Cow<'static, str>;
    fn description(&self) -> Cow<'static, str>;
    fn input_schema(&self) -> Cow<'static, str>;
    fn annotations(&self) -> ToolAnnotations;
    fn execute(
        &self,
        request: CallToolRequest,
    ) -> Pin<Box<dyn Future<Output = CallToolResult> + Send + '_>>;
}

Required Methods§

Source

fn name(&self) -> Cow<'static, str>

The name of the tool

Source

fn description(&self) -> Cow<'static, str>

The description of the tool

Source

fn input_schema(&self) -> Cow<'static, str>

The parameters of the tool

Source

fn annotations(&self) -> ToolAnnotations

The annotations of the tool

Source

fn execute( &self, request: CallToolRequest, ) -> Pin<Box<dyn Future<Output = CallToolResult> + Send + '_>>

Execute the tool

Implementors§

Source§

impl<T, I, O> Tool for T
where T: TypedTool<Input = I, Output = O> + Sync, I: DeserializeOwned, O: IntoToolResult,