Stateless, protocol-neutral pagination for MCP list operations.
Routers continue to return complete, deterministically ordered catalogs. The server applies this policy after dispatch, issuing opaque cursors scoped to the protocol version, list operation, configured page size, and exact catalog contents. A catalog change therefore expires outstanding cursors instead of risking duplicate or skipped entries.
Summary
Functions
Builds and validates an immutable pagination policy.
Returns one page and attaches a next cursor to result metadata when more entries remain.
Types
@type operation() ::
:tools_list | :prompts_list | :resources_list | :resource_templates_list
@type t() :: %Snodo.Pagination{page_size: pos_integer()}
Functions
Builds and validates an immutable pagination policy.
@spec page(Snodo.Result.t(), String.t(), operation(), map(), t()) :: {:ok, Snodo.Result.t()} | {:error, Snodo.Error.t()}
Returns one page and attaches a next cursor to result metadata when more entries remain.