fix: return all tools from paginated MCP tool lists (#19246)
## Background MCP servers with paginated tool lists exposed only first-page tools through client.tools(), silently making later tools unavailable. ## Root Cause DefaultMCPClient.tools() called listTools() once and ignored nextCursor, despite the response schema and listTools() API supporting cursors; the reproduction confirmed only one tools/list request was sent. ## Summary Updated tools() to follow each nextCursor and combine all returned tool definitions before creating the tool set. Added a patch changeset for @ai-sdk/mcp. ## Testing Added a regression test verifying that tools() requests the continuation cursor and returns tools from both pages. ## End-to-end Validation - `git show HEAD:examples/ai-functions/src/reproduction/issue-19240-mcp-tools-pagination.ts | pnpm -C examples/ai-functions exec tsx -` returned all three tools and recorded requests with cursors `null` and `page-2`. ## Related Issues Fixes #19240 Closes #19242 --------- Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com> Co-authored-by: habibthadev <109099706+habibthadev@users.noreply.github.com>
A
ai-sdk-factory[bot] committed
1175434706fa874e3ccf092900a79c90a937c9b9
Parent: 49ba214
Committed by GitHub <noreply@github.com>
on 8/24/2026, 10:46:51 PM