Problem
Several MCP tools return verbose JSON with redundant fields. Agents pay tokens for every byte of output. At scale (large codebases), a single trace call can return 5-10KB of JSON when 500 bytes would suffice.
Proposed Changes
1. Add --compact / format: 'compact' to all MCP tools
Strip file paths to relative, omit null fields, abbreviate edge labels (C=CALLS, I=IMPORTS).
2. Pagination on all list-type tools
Add limit + offset params to search, list, trace (with max_depth). Default limit=20, agents can request more if needed.
3. get_graph_schema tool
Returns node/edge counts, labels present, property keys — lets agents understand the shape of the graph in one cheap call before issuing queries.
4. Structured summary in get_architecture
Return: language breakdown, entry points, top-N hotspot files, package count. One call that answers 'what is this codebase' without reading any files.
Target
5 structural queries should cost <5k tokens total. Currently the same queries cost 30-80k tokens due to verbose output + large payloads.
Problem
Several MCP tools return verbose JSON with redundant fields. Agents pay tokens for every byte of output. At scale (large codebases), a single
tracecall can return 5-10KB of JSON when 500 bytes would suffice.Proposed Changes
1. Add
--compact/format: 'compact'to all MCP toolsStrip file paths to relative, omit null fields, abbreviate edge labels (C=CALLS, I=IMPORTS).
2. Pagination on all list-type tools
Add
limit+offsetparams tosearch,list,trace(withmax_depth). Default limit=20, agents can request more if needed.3.
get_graph_schematoolReturns node/edge counts, labels present, property keys — lets agents understand the shape of the graph in one cheap call before issuing queries.
4. Structured summary in
get_architectureReturn: language breakdown, entry points, top-N hotspot files, package count. One call that answers 'what is this codebase' without reading any files.
Target
5 structural queries should cost <5k tokens total. Currently the same queries cost 30-80k tokens due to verbose output + large payloads.