|
tools: list_tools tells the truth and costs a tenth of the context
The tool read the profile config, not the registry: a tool the config declares but nothing registered — mcp__navi_ui__render_component, whose server never connects — was advertised as callable, and the agent walked into "tool not found" (28 such warnings on prod). It now resolves every name against the live registry and reports the rest separately as "Not registered", so a phantom entry reads as a broken server, not as a tool to try. It also returned every description it could find. For server_admin that was 125 tools and 35 316 bytes per call — ~9k tokens to answer "do I have anything for ssh". Names are now grouped by source (native, then one section per MCP server) with descriptions behind verbose, and query filters by substring over names and descriptions: the ssh question costs 88 bytes instead of 35 KB, and a plain listing drops to 3.7 KB (9.5x smaller). Tests cover the phantom-tool case, query matching by name and by description, and the size property that makes names-only the default. |
|---|
|
|
| docs/tools.md |
|---|
| navi/tools/list_tools.py |
|---|
| tests/unit/tools/test_list_tools.py 0 → 100644 |
|---|