PaginatedEndpoint

A descriptor for a paginated RPC endpoint, tying together:

  1. A paginated REQ request type (e.g. sh.ondr.mcp4k.schema.prompts.ListPromptsRequest),

  2. A RES result type (e.g. sh.ondr.mcp4k.schema.prompts.ListPromptsResult),

  3. A requestFactory function to build each request page by page,

  4. A transform function converting the returned RES into higher-level ITEMS.

To see an example implementation of this interface, see sh.ondr.mcp4k.schema.prompts.ListPromptsRequest.Companion.

Parameters

REQ

The concrete request class that implements JsonRpcRequest.

RES

The paginated result class that implements PaginatedResult.

ITEMS

The type of items your application wants to consume or emit for each page.

Inheritors

Properties

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun transform(result: RES): ITEMS

Takes the RES object (the server's result) and transforms it into the items to be emitted, typically a List.