pub trait Tool:
Debug
+ WasmCompatSend
+ WasmCompatSync {
// Required methods
fn name(&self) -> &ToolName;
fn description(&self) -> &ToolDescription;
fn parameters(&self) -> &GenerationSchema;
fn call(&self, args: Value) -> ToolResult;
}Expand description
Trait boundary implemented by callable Rust tools.
Required Methods§
Sourcefn description(&self) -> &ToolDescription
fn description(&self) -> &ToolDescription
Returns the human-readable tool description visible to the model.
Sourcefn parameters(&self) -> &GenerationSchema
fn parameters(&self) -> &GenerationSchema
Returns the JSON argument schema visible to the model.
Sourcefn call(&self, args: Value) -> ToolResult
fn call(&self, args: Value) -> ToolResult
Executes the tool with model-supplied arguments.
§Errors
Returns ToolCallError when the handler cannot satisfy the model’s
request. The error text is forwarded back through the bridge as the tool
result error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".