Tool Protocol • Rust AI Agent SDK
ToolProtocol: Protocol for tool implementations.
ToolProtocol
Defined in the protocols module.
Rust AI Agent SDK
Protocol for tool implementations.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
agent["Agent"] -- "uses" --> tool["Tool: ToolProtocol"]
tool -- "returns" --> result["Result"]
style tool fill:#189AB4,color:#fff
style agent fill:#8B0000,color:#fff
style result fill:#8B0000,color:#fffMethods
name
fn name(&self) -> &strGet the tool’s name
description
fn description(&self) -> &strGet the tool’s description
parameters_schema
fn parameters_schema(&self) -> serde_json::ValueGet the tool’s parameter schema
execute
async fn execute(&self, args: serde_json::Value) -> Result<serde_json::Value>Execute the tool with arguments
Parameters:
| Name | Type |
|---|---|
args | serde_json::Value |
Source
View on GitHubpraisonai/src/protocols/mod.rs at line 0