Skip to content

fix: paginate tool listing#248

Open
haosenwang1018 wants to merge 1 commit intophilschmid:mainfrom
haosenwang1018:fix/paginate-list-tools
Open

fix: paginate tool listing#248
haosenwang1018 wants to merge 1 commit intophilschmid:mainfrom
haosenwang1018:fix/paginate-list-tools

Conversation

@haosenwang1018
Copy link
Copy Markdown

Summary

  • follow nextCursor when listing MCP tools
  • return all tool pages before applying downstream filtering
  • add a client unit test that covers paginated tool discovery

Problem

Issue #206 reports that mcp-cli silently drops tools from servers that paginate tools/list responses. The current client only requests the first page.

Fix

listTools() now keeps requesting tool pages until nextCursor is exhausted, then returns the full aggregated list. This makes list, grep, info, and the tool existence checks in call work correctly with paginated MCP servers.

Fixes #206

Validation

  • git diff --check
  • npx tsc --noEmit
  • bun test tests/client.test.ts
  • bun test tests/config.test.ts
  • bun test tests/output.test.ts
  • npx @biomejs/biome check src/client.ts tests/client.test.ts

Signed-off-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
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.

Some tools are missing when connecting to servers with many tools

1 participant