Summary
The map tool returns a fixed JSON shape (top-level layout + per-file aggregates) with no way to request just specific sections (e.g., only the directory tree, only the language histogram, only hotspot summary) or to control aggregation depth. Callers that want a 1-line summary pay for the same payload as callers that want the full tree, which wastes MCP token budget.
Where
src/CodeIndex/Mcp/McpToolHandlers.cs (map handler — fixed response composition)
src/CodeIndex/Cli/QueryCommandRunner.cs (map CLI runner)
Suggested approach
(1) Add a --sections=<comma-list> selector with values like tree, languages, hotspots, metrics. (2) Add --depth=N to cap directory tree depth (currently unbounded). (3) Document that omitting --sections returns everything (back-compatible default).
Summary
The
maptool returns a fixed JSON shape (top-level layout + per-file aggregates) with no way to request just specific sections (e.g., only the directory tree, only the language histogram, only hotspot summary) or to control aggregation depth. Callers that want a 1-line summary pay for the same payload as callers that want the full tree, which wastes MCP token budget.Where
src/CodeIndex/Mcp/McpToolHandlers.cs(map handler — fixed response composition)src/CodeIndex/Cli/QueryCommandRunner.cs(map CLI runner)Suggested approach
(1) Add a
--sections=<comma-list>selector with values liketree,languages,hotspots,metrics. (2) Add--depth=Nto cap directory tree depth (currently unbounded). (3) Document that omitting--sectionsreturns everything (back-compatible default).