Skip to main content

Module progressive_tools

Module progressive_tools 

Source
Expand description

§Progressive Tool View

Token-efficient tool definition management for LLM requests.

§Problem

Sending full JSON Schema definitions for all tools on every LLM request wastes significant tokens. A workspace with 10+ MCP tools can easily consume 700+ tokens on schema alone — even for simple chat messages that don’t need any tools.

§Solution

ProgressiveToolView implements a “menu first, recipe on demand” strategy:

  1. Initial state (~50 tokens): system prompt includes only tool names and one-line descriptions.
  2. On activation: when the LLM mentions $tool_name or actually calls a tool, that tool’s full schema is included in subsequent requests.

This typically saves 90%+ of tool-related token usage for simple conversations, and progressively reveals schemas as the agent needs them.

Structs§

ProgressiveToolView
Token-efficient tool view that progressively reveals tool schemas.