Skip to content

fix: follow paginated tool listings - #93

Draft
Rutvik552k wants to merge 1 commit into
grll:mainfrom
Rutvik552k:fix-list-tools-pagination
Draft

Rutvik552k wants to merge 1 commit into
grll:mainfrom
Rutvik552k:fix-list-tools-pagination

Conversation

@Rutvik552k

@Rutvik552k Rutvik552k commented Oct 6, 2026 •

Copy link
Copy Markdown

Summary

  • add a shared tool-listing helper that follows MCP list_tools nextCursor pages
  • use it from mcptools(), MCPAdapt.tools(), and MCPAdapt.atools()
  • cover empty intermediate pages, opaque cursor order, fresh refresh, multiple sessions, and call binding to later-page tools

Verification

  • Remote PR head verified: Rutvik552k:fix-list-tools-pagination points to 6955fd3
  • Base 538cd85 with these regression tests copied over: 3 failed, showing only first-page tools were returned
  • Fixed branch: PYTHONPATH=src uv run pytest tests/test_core.py::test_atools_uses_all_pages_for_independent_sessions_and_call_bindings tests/test_core.py::test_tools_uses_all_pages_on_fresh_refresh_and_preserves_session_binding tests/test_core.py::test_mcptools_uses_all_pages -q -p no:cacheprovider -> 3 passed
  • PYTHONPATH=src uv run ruff check src/mcpadapt/core.py tests/test_core.py -> All checks passed
  • PYTHONPATH=src uv run pytest --cov=mcpadapt --cov-report=term-missing tests/test_core.py::test_atools_uses_all_pages_for_independent_sessions_and_call_bindings tests/test_core.py::test_tools_uses_all_pages_on_fresh_refresh_and_preserves_session_binding tests/test_core.py::test_mcptools_uses_all_pages -q -p no:cacheprovider -> 3 passed, TOTAL 15% coverage for this focused subset (below the repo-wide 95% requirement because this was not the full suite)
  • Base comparison for mypy: PYTHONPATH=/src uv run mypy /src/mcpadapt/core.py -> same Cannot call function of unknown type error at the corresponding TRANSPORTS call site
  • Additional local triage on the fixed branch: stdio/local core tests passed 8 passed in 20.24s; SSE core tests passed 4 passed in 14.14s; WebSocket core tests passed 4 passed in 6.59s
  • Streamable HTTP comparison: fixed branch test_basic_sync_streamable_http failed with TimeoutError after 30s plus mcp.client.streamable_http teardown read error; the same test on untouched base failed the same way after 30s

Limitations

  • GitHub CI run 37541743505 for head 6955fd3 completed with conclusion action_required and no check jobs/check runs, so this PR does not have upstream CI results yet.
  • Full repository checks were not completed locally. The focused pagination tests passed, but full tests/coverage remain blocked by the streamable HTTP behavior above; the focused 15% coverage number is not the repo-wide 95% coverage check.
  • PYTHONPATH=src uv run mypy src/mcpadapt/core.py still reports the TRANSPORTS callable typing issue; the same error was reproduced on untouched base, so it is outside this pagination change.

Generated with assistance from OpenAI Codex.

This branch has not been deployed

No deployments
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