Repository navigation
fix(mcp): a cut list page reports the rows it holds, not the page asked for (ZERNIO-1901) - #127
Merged
Merged
Conversation
…ed for (ZERNIO-1901) A result over 80,000 characters keeps the first items that fit, aligned to a divisor of the page size, but `pagination` still said limit=40 with the untouched total while 20 items came back. An agent paging by `page` then skipped the items that were cut. Only the `_truncated` note said so. A cut page now carries the page and limit of the items it holds, `pages` from `total`, and hasMore true, so following `pagination` reads every item once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs below 1 are left alone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Feedback 6afec5e8235f576c53e34685 (ZERNIO-1901): list tools return 20 rows for
limit=40whilepagination.limitstays 40 andtotalis unchanged.The rows are cut in the MCP, not by the API: results over 80,000 characters are cut to the items that fit (
src/late/mcp/response_format.py, #88), and the MCP's telemetry marks these callstruncated. It kept 20 of 40 items and said so only in the_truncatednote, whilepaginationstill described the page asked for. An agent that pages bypagewith its own limit then skips the cut items.Evidence (Axiom
zernio-mcp, this customer, 2026-11-19 08:00 to 10:30 UTC):posts_list_postswith limit 40 was cut in 38 of 41 calls (up to 99,513 characters before the cut),analytics_get_analyticsin 3 of 39. No limit 20 call was cut.What
page+limit) reports what it holds:limitis the kept count,pagethe equivalent page under it,pagesis recomputed fromtotal,hasMoreis true when the API reported it. Followingpaginationreads every item once.pageandnextCursor(posts) are renumbered too and still losenextCursor, which would skip the cut rows. Pages withoutpage/limitkeep the note, as before. The note now says to sendlimitandpagetogether.Follow-ups
posts_list_postsalso takesoffset, and the API answerspage = floor(offset / limit) + 1. With an unaligned offset the rewritten page re-reads rows (it never skips any), as the note already did. A client that takespagefrom the response but keeps its ownlimitskips more from page 2 on than before; following both fields is right.cursorkeepspage1 in the API's answer, so a cut cursor page is renumbered from the top and followingpagere-reads rows (never skips); the note's cursor step is the right one there, as before.🤖 Generated with Claude Code