pub trait Tool: Send + Sync {
// Required methods
fn schema(&self) -> ToolSchema;
fn invoke<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, KernelError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn name(&self) -> ToolName { ... }
}Expand description
A composable, side-effectful capability.
Implementations MUST be cheap to clone (typically Arc-wrapped state) so
the same tool instance can be referenced from multiple agents’
super::registry::ToolRegistry slices.
Required Methods§
Sourcefn schema(&self) -> ToolSchema
fn schema(&self) -> ToolSchema
Return this tool’s JSON-Schema-compatible contract.