Skip to content

map response shape is fixed; no --sections selector or depth control #1635

Description

@Widthdom

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions