Tool Discovery
When Pando accumulates many tools (from MCP servers, Lua hooks, and built-in tools), the Tool Discovery system manages complexity by showing only a visible subset and providing on-demand search for the rest.
How It Works
Inspired by VS Code Copilot’s approach:
- Core tools (bash, edit, view, glob, grep, write) are always visible
- MCP and Lua tools are deferred by default
- When the total tool count exceeds
MaxDirectTools, thetool_searchtool activates - The LLM searches the full registry by natural language
- Discovered tools remain visible for the rest of the session
Configuration
[ToolDiscovery]
Enabled = true
Mode = 'auto' # 'auto', 'always', or 'off'
MaxDirectTools = 64 # Threshold for auto mode
SearchLimit = 8 # Default results from tool_search
NonDeferredTools = [] # Tools always visible
DeferredSources = [] # Sources to defer (e.g. "mcp", "lua")Modes
| Mode | Behavior |
|---|---|
auto | Activates when tools exceed MaxDirectTools |
always | Always defers non-core tools |
off | All tools visible (default for small setups) |
Tool Search
The LLM calls tool_search with a natural language query:
{
"query": "search code in repository"
}Results are ranked using term-frequency scoring over name, aliases, server name, description, and parameter names.
Source Filtering
Tools are categorized by source:
core- Built-in tools (always visible)internal- Pando internal toolsmcp- External MCP server toolslua- Lua hook toolsmesnada- Orchestration toolsrag- Knowledge base and code index toolsgateway- MCP gateway re-exports
For most users with fewer than 64 tools, Tool Discovery stays inactive. It only activates when the tool count grows large enough to impact context window usage.