pub struct ProgressiveToolView { /* private fields */ }Expand description
Token-efficient tool view that progressively reveals tool schemas.
Only activated tools have their full JSON Schema included in LLM requests. Inactive tools appear only as compact name + description entries in the system prompt.
Implementations§
Source§impl ProgressiveToolView
impl ProgressiveToolView
Sourcepub fn new(tools: Vec<ToolDescriptor>) -> Self
pub fn new(tools: Vec<ToolDescriptor>) -> Self
Create a new progressive view from the full tool list.
All tools start as inactive (compact view only).
Sourcepub fn activate(&mut self, tool_id: &str)
pub fn activate(&mut self, tool_id: &str)
Activate a specific tool by ID (its full schema will be sent).
Sourcepub fn activate_hints(&mut self, text: &str)
pub fn activate_hints(&mut self, text: &str)
Scan LLM output text for $tool_name hints and activate mentioned tools.
This allows the LLM to signal interest in a tool before actually calling it, so the full schema is available on the next turn.
Sourcepub fn is_activated(&self, tool_id: &str) -> bool
pub fn is_activated(&self, tool_id: &str) -> bool
Returns true if the given tool has been activated.
Sourcepub fn activated_count(&self) -> usize
pub fn activated_count(&self) -> usize
Returns the number of currently activated tools.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Returns the total number of tools in the view.
Sourcepub fn summary_prompt(&self) -> String
pub fn summary_prompt(&self) -> String
Returns a compact summary prompt listing all tools by name and description, suitable for injection into the system prompt.
Returns an empty string when no tools are available.
Sourcepub fn activated_tools(&self) -> Vec<ToolDescriptor>
pub fn activated_tools(&self) -> Vec<ToolDescriptor>
Returns full descriptors for activated tools only.
These are the tools whose complete JSON Schema should be sent to the LLM (either in the prompt or via native tool calling API).
Sourcepub fn all_tools(&self) -> &[ToolDescriptor]
pub fn all_tools(&self) -> &[ToolDescriptor]
Returns all tool descriptors regardless of activation state.