pub trait ToolGuide: Send + Sync {
// Required methods
fn tool_name(&self) -> &str;
fn when_to_use(&self) -> &str;
fn when_not_to_use(&self) -> &str;
fn examples(&self) -> Vec<ToolExample>;
fn related_tools(&self) -> Vec<&str>;
fn category(&self) -> ToolCategory;
}Expand description
Trait for defining tool usage guides
Implement this trait to provide contextual guidance for tools, helping LLMs understand when and how to use them effectively.
§Required Methods
tool_name: Unique identifier for the toolwhen_to_use: Guidance on appropriate use caseswhen_not_to_use: Scenarios where the tool should be avoidedexamples: Concrete usage examplesrelated_tools: Other tools that work well with this onecategory: Logical grouping for the tool
Required Methods§
Sourcefn when_to_use(&self) -> &str
fn when_to_use(&self) -> &str
Returns guidance on when this tool should be used
Sourcefn when_not_to_use(&self) -> &str
fn when_not_to_use(&self) -> &str
Returns guidance on when this tool should NOT be used
Sourcefn examples(&self) -> Vec<ToolExample>
fn examples(&self) -> Vec<ToolExample>
Returns usage examples for this tool
Returns names of related tools that complement this one
Sourcefn category(&self) -> ToolCategory
fn category(&self) -> ToolCategory
Returns the category this tool belongs to