Repository navigation
fix #516: follow tools/list pagination - #517
Open
AnKiT-GaRG2 wants to merge 1 commit into
Open
AnKiT-GaRG2 wants to merge 1 commit into
AnKiT-GaRG2 wants to merge 1 commit into
Conversation
AnKiT-GaRG2
force-pushed
the
fix/mcp-tool-errors-and-pagination
branch
from
November 7, 2026 21:53
983c314 to
125d9c1
Compare
Contributor
Author
|
Rebased onto current |
ahmad-ajmal
force-pushed
the
dev
branch
2 times, most recently
from
November 20, 2026 10:15
c8365d2 to
57aed8d
Compare
tools/list is paginated by the MCP spec, but discovery stopped after the first page, so every tool past it was lost. Follow nextCursor until the server stops returning one, and stop on a repeated cursor. Signed-off-by: Ankit Garg <146389256+AnKiT-GaRG2@users.noreply.github.com>
AnKiT-GaRG2
force-pushed
the
fix/mcp-tool-errors-and-pagination
branch
from
December 1, 2026 09:26
125d9c1 to
eba55ec
Compare
AnKiT-GaRG2
marked this pull request as ready for review
December 1, 2026 09:26
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.
What
_discover_toolsfollowsnextCursoracrosstools/listpages, with a guard against a repeated cursor.tests/test_mcp_tools_list_pagination.py(2 tests).Rebased onto current
dev. TheisErrorhalf of the original PR is dropped:devalready reportsisError: trueresults as errors since v1.4.5 (#534), and its tests cover that.Why
tools/listis paginated in the MCP spec, so servers with paged tool lists lost every tool after the first page.Closes #516
How to test
On current
devboth new tests fail; with this change they pass, and the other MCP tests still pass. Ruff 0.16.1 (the CI pin) is clean on the changed files.Screenshots / Logs
Earlier live check, same pagination code: a stdio server built on the official MCP Python SDK (
mcp2.3.0) that pages its 5 tools two at a time, driven through CraftBot'sMCPServerConnection. Ondev(af80866) it discoveredt1, t2; with this change it discoveredt1, t2, t3, t4, t5. Not re-run after this rebase.