Skip to main content

Tool

Trait Tool 

Source
pub trait Tool: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn parameters_schema(&self) -> Value;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        args: Value,
    ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn execute_with_progress<'life0, 'life1, 'async_trait>(
        &'life0 self,
        args: Value,
        _sink: &'life1 dyn ProgressSink,
    ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn spec(&self) -> ToolSpec { ... }
}
Expand description

Core tool trait — implement for any capability

Required Methods§

Source

fn name(&self) -> &str

Tool name (used in LLM function calling)

Source

fn description(&self) -> &str

Human-readable description

Source

fn parameters_schema(&self) -> Value

JSON schema for parameters

Source

fn execute<'life0, 'async_trait>( &'life0 self, args: Value, ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the tool with given arguments

Provided Methods§

Source

fn execute_with_progress<'life0, 'life1, 'async_trait>( &'life0 self, args: Value, _sink: &'life1 dyn ProgressSink, ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute the tool with a progress-notification sink.

This is an additive, opt-in entry point for long-running tools that want to emit progress updates (modeled on MCP notifications/progress). The default implementation simply forwards to Tool::execute and ignores sink, so every existing tool keeps compiling and behaving identically.

Callers that do not care about progress should keep calling Tool::execute directly; callers that do (e.g. the forthcoming in-process MCP server) call execute_with_progress with a real sink and forward emissions as MCP notifications.

Source

fn spec(&self) -> ToolSpec

Get the full spec for LLM registration

Implementors§

Source§

impl Tool for ProgressEnvelope

Source§

impl Tool for SkillsDescribeTool

Source§

impl Tool for SkillsExecuteTool

Source§

impl Tool for SkillsListTool

Source§

impl Tool for AskUserTool

Source§

impl Tool for BackupTool

Source§

impl Tool for BrowserTool

Source§

impl Tool for BrowserDelegateTool

Source§

impl Tool for BrowserOpenTool

Source§

impl Tool for CalculatorTool

Source§

impl Tool for CanvasTool

Source§

impl Tool for ClaudeCodeTool

Source§

impl Tool for ClaudeCodeRunnerTool

Source§

impl Tool for CloudOpsTool

Source§

impl Tool for CloudPatternsTool

Source§

impl Tool for CodexCliTool

Source§

impl Tool for ComposioTool

Source§

impl Tool for ContentSearchTool

Source§

impl Tool for CronAddTool

Source§

impl Tool for CronListTool

Source§

impl Tool for CronRemoveTool

Source§

impl Tool for CronRunTool

Source§

impl Tool for CronRunsTool

Source§

impl Tool for CronUpdateTool

Source§

impl Tool for DataManagementTool

Source§

impl Tool for DelegateTool

Source§

impl Tool for DiscordSearchTool

Source§

impl Tool for EscalateToHumanTool

Source§

impl Tool for FileEditTool

Source§

impl Tool for FileReadTool

Source§

impl Tool for FileWriteTool

Source§

impl Tool for GeminiCliTool

Source§

impl Tool for GitOperationsTool

Source§

impl Tool for GlobSearchTool

Source§

impl Tool for GoogleWorkspaceTool

Source§

impl Tool for HttpRequestTool

Source§

impl Tool for ImageGenTool

Source§

impl Tool for ImageInfoTool

Source§

impl Tool for JiraTool

Source§

impl Tool for LinkedInTool

Source§

impl Tool for LlmTaskTool

Source§

impl Tool for McpToolWrapper

Source§

impl Tool for Microsoft365Tool

Source§

impl Tool for ModelRoutingConfigTool

Source§

impl Tool for ModelSwitchTool

Source§

impl Tool for NodeTool

Source§

impl Tool for NotionTool

Source§

impl Tool for OpenCodeCliTool

Source§

impl Tool for PdfReadTool

Source§

impl Tool for PipelineTool

Source§

impl Tool for PollTool

Source§

impl Tool for ProjectIntelTool

Source§

impl Tool for ProxyConfigTool

Source§

impl Tool for PushoverTool

Source§

impl Tool for ReactionTool

Source§

impl Tool for ReadSkillTool

Source§

impl Tool for ReportTemplateTool

Source§

impl Tool for ScheduleTool

Source§

impl Tool for ScreenshotTool

Source§

impl Tool for SecurityOpsTool

Source§

impl Tool for SessionsHistoryTool

Source§

impl Tool for SessionsListTool

Source§

impl Tool for SessionsSendTool

Source§

impl Tool for ShellTool

Source§

impl Tool for SkillHttpTool

Source§

impl Tool for SkillShellTool

Source§

impl Tool for SopAdvanceTool

Source§

impl Tool for SopApproveTool

Source§

impl Tool for SopExecuteTool

Source§

impl Tool for SopListTool

Source§

impl Tool for SopStatusTool

Source§

impl Tool for ArcToolRef

Source§

impl Tool for SwarmTool

Source§

impl Tool for TextBrowserTool

Source§

impl Tool for ToolSearchTool

Source§

impl Tool for VerifiableIntentTool

Source§

impl Tool for WeatherTool

Source§

impl Tool for WebFetchTool

Source§

impl Tool for WebSearchTool

Source§

impl Tool for WorkspaceTool