Skip to main content

ToolGuide

Trait ToolGuide 

Source
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 tool
  • when_to_use: Guidance on appropriate use cases
  • when_not_to_use: Scenarios where the tool should be avoided
  • examples: Concrete usage examples
  • related_tools: Other tools that work well with this one
  • category: Logical grouping for the tool

Required Methods§

Source

fn tool_name(&self) -> &str

Returns the tool’s unique name

Source

fn when_to_use(&self) -> &str

Returns guidance on when this tool should be used

Source

fn when_not_to_use(&self) -> &str

Returns guidance on when this tool should NOT be used

Source

fn examples(&self) -> Vec<ToolExample>

Returns usage examples for this tool

Source

fn related_tools(&self) -> Vec<&str>

Returns names of related tools that complement this one

Source

fn category(&self) -> ToolCategory

Returns the category this tool belongs to

Implementors§