Skip to main content

BuiltinTool

Trait BuiltinTool 

Source
pub trait BuiltinTool: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn spec(&self) -> &BuiltinToolSpec;
    fn execute(&self, args: Value) -> Result<Value, ToolError>;
}
Expand description

Trait for built-in kernel tools.

Each tool has a spec and an execute method. Tools hold their own dependencies (e.g. Arc<ProcessTable> for agent tools).

Required Methods§

Source

fn name(&self) -> &str

Return the tool name (e.g. “fs.read_file”).

Source

fn spec(&self) -> &BuiltinToolSpec

Return the tool specification.

Source

fn execute(&self, args: Value) -> Result<Value, ToolError>

Execute the tool with the given JSON arguments.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§