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 category(&self) -> ToolCategory { ... }
fn origin(&self) -> ToolOrigin { ... }
fn is_terminal(&self) -> bool { ... }
fn spec(&self) -> ToolSpec { ... }
}Expand description
Core tool trait for agent capabilities.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description shown to the LLM.
Sourcefn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON Schema for the tool’s parameters.
Provided Methods§
Sourcefn category(&self) -> ToolCategory
fn category(&self) -> ToolCategory
Tool category for profile-based filtering.
Sourcefn origin(&self) -> ToolOrigin
fn origin(&self) -> ToolOrigin
Runtime ownership surface for this tool.
Sourcefn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
Whether calling this tool should immediately end the turn loop.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".