Skip to content

Feature: uniform caller-controlled output budgets (max_results/max_lines) + self-reported truncation on all tools #1460

Description

@eazene

Feature request

Caller-controlled output budget parameters — max_results / max_lines / max_direct / max_transitive (or a single max_tokens) — accepted by every query tool, with truncation self-reported in the response (truncated: true, counts of what was dropped).

Why

For multi-agent use (orchestrators assembling task packets for worker agents), the caller knows its token budget; the server doesn't. Today budgets are only partially controllable (limit/offset on some tools; get_code_snippet caps at 500 lines) and not uniform.

Surveyed 10 comparable code-graph MCP servers: the two with the best agent ergonomics both do this — one exposes per-call max_results/max_lines/max_direct/max_transitive on nearly every tool; another hard-caps at 500 rows / 16k tokens and tells the model what was dropped. A silently truncated result is worse than a small one: the agent reasons confidently over the missing half.

Sketch

  • Uniform optional max_rows + max_snippet_lines on all 15 tools (aliases fine).
  • Responses always carry exact totals + truncated (much of this discipline already exists in trace_path/detect_changes — this is about making it uniform and caller-tunable downward).
  • Bonus: a get_usage_stats-style per-session accounting tool (calls by name, chars returned) so operators can measure token savings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    parsing/qualityGraph extraction bugs, false positives, missing edges

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions