Skip to content

feat(mcp)!: a listing tool gives 50 items when no limit is asked - #566

Merged
bim-ba merged 1 commit into
mainfrom
feat/mcp-default-limit-50
Oct 10, 2026
Merged

bim-ba merged 1 commit into
mainfrom
feat/mcp-default-limit-50

Conversation

@bim-ba

@bim-ba bim-ba commented Oct 10, 2026

Copy link
Copy Markdown
Owner

A list tool of the MCP server called with no limit now gives 50 items, not 500, says truncated: true and gives next to go on. A command keeps 500.

Why

A tool's answer is read whole into a model's context. Measured in #561: tracker_issues_list with no limit took about 206 thousand tokens at the cap of 500.

This changes #502 for the MCP server only: the default of a tool and of a command are no longer one number. The owner's decision in #561, 2026-10-10.

What changes

Before After
a tool, no limit YCLI__HTTP__MAX_ITEMS (500) YCLI__HTTP__MAX_TOOL_ITEMS (50)
a tool, limit=N or all=true as asked as asked
a command, no --limit YCLI__HTTP__MAX_ITEMS (500) the same

HTTPConfig.max_tool_items and HTTPConfig.tool_cap(...) sit beside max_items and cap(...). The tail of every tool's limit description names the variable that decides.

What holds it

  • The ast-grep rule tool-takes-the-tool-cap forbids config.http.cap( in any mcp module, so a new tool cannot take the command's cap. Its fix was the codemod: before it the scan reported 48 errors of this rule, one per tool; after ast-grep scan --update-all, none.
  • Two tests in tests/unit/cli/test_listing_handles.py: of 60 boards a tool gives 50 and next while the command gives 60; and the tool's cap is a setting of its own.
  • The contract test and the three-surface comparison of the live harness give a tool the command's cap, because one case states the requests of every surface. The default itself is held by the two tests above.

Also here

Breaking change

A list tool of the MCP server called with no limit returns 50 items in place of 500. Pass limit, go on with next, or set YCLI__HTTP__MAX_TOOL_ITEMS.

Verified

On this head, over main 81bc214d (0.133.0): ruff, ty, lint-imports (6 kept), ast-grep, rulesync and the generated reference without drift; the full suite: 5475 passed, 5 skipped, coverage 100 %.

Live (2026-10-10, before the rebase onto 0.133.0): YCLI_E2E=1 pytest e2e -m live -k "tracker and reads": 1 passed, the new step included; one older step skipped (needs TRIGGER). NOT RUN: the full live run over every service; CI runs it.

🤖 Generated with Claude Code

A tool's answer is read whole into a model's context: `tracker_issues_list`
with no `limit` took about 206 thousand tokens at the cap of 500 (#561). A tool
now stops at `YCLI__HTTP__MAX_TOOL_ITEMS` (50), says `truncated: true` and gives
`next` to go on; `limit` and `all` work as before. A command keeps its own cap,
`YCLI__HTTP__MAX_ITEMS` (500).

This changes #502 for the MCP server only (the owner's decision in #561,
2026-10-10): the default of a tool and of a command are no longer one number.

An ast-grep rule, `tool-takes-the-tool-cap`, holds every tool to
`config.http.tool_cap(...)`, so a new tool cannot take the command's cap; its
fix was the codemod for the 48 tools.

The live scenarios gain a step that reads a listing as `-o json` prints it and
asserts where it stopped (`output: listing`), on a real reply.

BREAKING CHANGE: a list tool of the MCP server called with no `limit` returns
50 items in place of 500. Pass `limit`, go on with `next`, or set
`YCLI__HTTP__MAX_TOOL_ITEMS`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
yandex-e2e — c0fd8f65 Deployed Oct 10, 2026 by bim-ba via live (all) #698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant