Repository navigation
feat(mcp)!: a listing tool gives 50 items when no limit is asked - #566
Merged
Merged
Conversation
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 was referenced Oct 10, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A list tool of the MCP server called with no
limitnow gives 50 items, not 500, saystruncated: trueand givesnextto go on. A command keeps 500.Why
A tool's answer is read whole into a model's context. Measured in #561:
tracker_issues_listwith nolimittook 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
limitYCLI__HTTP__MAX_ITEMS(500)YCLI__HTTP__MAX_TOOL_ITEMS(50)limit=Norall=true--limitYCLI__HTTP__MAX_ITEMS(500)HTTPConfig.max_tool_itemsandHTTPConfig.tool_cap(...)sit besidemax_itemsandcap(...). The tail of every tool'slimitdescription names the variable that decides.What holds it
tool-takes-the-tool-capforbidsconfig.http.cap(in anymcpmodule, so a new tool cannot take the command's cap. Itsfixwas the codemod: before it the scan reported 48 errors of this rule, one per tool; afterast-grep scan --update-all, none.tests/unit/cli/test_listing_handles.py: of 60 boards a tool gives 50 andnextwhile the command gives 60; and the tool's cap is a setting of its own.Also here
tracker/reads/where-a-listing-stopped, with a new step kindoutput: listing: it reads a listing as-o jsonprints it and assertstruncated,nextandtotalon a real reply (asked for in the review of feat!: every listing takeslimit, everything andnexton the SDK, the CLI and the MCP server #534).--limitsets the page size for the pieces after it.Breaking change
A list tool of the MCP server called with no
limitreturns 50 items in place of 500. Passlimit, go on withnext, or setYCLI__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 (needsTRIGGER). NOT RUN: the full live run over every service; CI runs it.🤖 Generated with Claude Code