Repository navigation
Description
Is your feature request related to a problem? Please describe.
Zoo Code puts the definitions of all enabled MCP tools into the prompt. I think it does this for every request. Each tool definition uses tokens. Many MCP servers use a large part of the context window before the task starts. A large tool list can also make tool selection less accurate.
My setup:
- Zoo Code version:
3.90.0 (baf19351) - Enabled MCP servers:
173 - Tokens used at the start of a new task:
100k
Describe the solution you'd like
Add an optional setting for deferred loading of MCP tools. Claude Code has a similar function called Tool Search (see anthropics/claude-code#7336).
The function works in this way:
- The prompt contains only a short list of the deferred tools. Each entry has the server name, the tool name, and a short description.
- A built-in search tool lets the model find a tool by keyword or by exact name.
- The search tool loads the full schema of the tools it finds. The model can call these tools from the next turn.
- Zoo Code keeps the loaded tools for the rest of the task.
- Zoo Code does this on the client side. The function works with all providers.
Suggested configuration:
{
"mcpServers": {
"example-server": {
"command": "...",
"deferLoading": true,
"alwaysLoadTools": ["critical_tool"]
}
}
}Also add a global setting with these values: eager, deferred, and auto. Auto defers the tools when they use more than a set number of tokens. The default value stays eager. Existing users see no change.
Please keep the auto-approve settings valid for tools that Zoo Code loads on demand.
Describe alternatives you considered
- I turn MCP servers on and off by hand for each task. This takes time, and I forget it often.
- I allow MCP tools in only some modes. This reduces the context size, but it does not give access to all tools when I need them.
- I use a proxy such as
lazy-mcp. It shows only a few meta-tools to the client. This needs extra setup and one more program.
Additional context
- Claude Code: Tool Search defers MCP tool definitions. See Feature Request: Lazy Loading for MCP Servers and Tools (95% context reduction possible) anthropics/claude-code#7336.
- Anthropic API: the Tool Search Tool with
defer_loading. - [Feature]: on-demand MCP tool loading via
tool_search(deferred tool activation) zeroclaw-labs/zeroclaw#3095: a client-sidetool_searchfor deferred MCP tools. - I can test a beta build. I can also give more measurements.
Activity