Skip to content

feat: add withCursorPagination to withStandardDecorators#47

Merged
hifi-phil merged 1 commit intodevfrom
feat/cursor-pagination-in-standard-decorators
Apr 10, 2026
Merged

feat: add withCursorPagination to withStandardDecorators#47
hifi-phil merged 1 commit intodevfrom
feat/cursor-pagination-in-standard-decorators

Conversation

@hifi-phil
Copy link
Copy Markdown
Contributor

Summary

  • Adds withCursorPagination to the withStandardDecorators decorator chain so all hosts (stdio, hosted, any future) get cursor pagination automatically
  • Introduces CursorPaginatedArgs<Args> conditional type that correctly reflects the schema transformation (skip/take → optional cursor) at the TypeScript level
  • Exports CursorPaginatedArgs from the SDK public API for consumer use

Details

Previously withCursorPagination had to be applied separately by each host's tool registrar. Now it's part of the standard decorator chain, applied between input sanitization and error handling.

The return type of withStandardDecorators is now ToolDefinition<CursorPaginatedArgs<Args>, OutputArgs> — tools with skip/take in their input schema will have the correct type showing cursor? instead, so consumers get proper type-checking when calling tool handlers.

Test plan

  • All 479 SDK unit tests pass
  • TypeScript compiles cleanly
  • Verify CMS MCP integration tests compile without type errors against updated SDK

🤖 Generated with Claude Code

@hifi-phil hifi-phil force-pushed the feat/cursor-pagination-in-standard-decorators branch 3 times, most recently from 275028f to fc1bafe Compare April 10, 2026 10:07
Moves cursor pagination into the standard decorator chain so all hosts
(stdio, hosted, any future) get it automatically. The return type uses
CursorPaginatedArgs<Args> to correctly reflect the schema transformation
(skip/take → optional cursor) at the TypeScript level.

Updates template list-examples test to use cursor-based pagination.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hifi-phil hifi-phil force-pushed the feat/cursor-pagination-in-standard-decorators branch from fc1bafe to d8e194e Compare April 10, 2026 10:12
@hifi-phil hifi-phil merged commit 3f0e6c4 into dev Apr 10, 2026
7 checks passed
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