ToolDyn

Trait ToolDyn 

Source
pub trait ToolDyn: Send + Sync {
    // Required methods
    fn name(&self) -> String;
    fn definition(
        &self,
        prompt: String,
    ) -> Pin<Box<dyn Future<Output = ToolDefinition> + Send + Sync + '_>>;
    fn call(
        &self,
        args: String,
    ) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + '_>>;
}
Expand description

Wrapper trait to allow for dynamic dispatch of simple tools

Required Methods§

Source

fn name(&self) -> String

Source

fn definition( &self, prompt: String, ) -> Pin<Box<dyn Future<Output = ToolDefinition> + Send + Sync + '_>>

Source

fn call( &self, args: String, ) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + '_>>

Implementors§

Source§

impl ToolDyn for McpTool

Available on crate feature rmcp only.
Source§

impl<T: Tool> ToolDyn for T