Skip to main content

API Pagination

When querying overarching HasMCP list databases directly via the external REST architectural layer (e.g. listing dozens of tools or servers), a standard cursor-based pagination model is systematically deployed. HasMCP strictly enforces tokenized orchestration to ensure fast query responses and limit payload sizes.

The Pagination Parameters

All GET endpoints that return a List[Entity]Response accept two core URL query strings:
  • limit: An integer dictating the maximum explicit number of physical objects allowed to be returned. Example: ?limit=100.
  • token: The opaque cryptographic cursor identifying the specific database offset for the next page of results.

The Response Structure

A successfully processed array payload reliably returns the data alongside pagination metadata:
{
 "matchCount": 850,
 "nextToken": "A1B2C3D4E5F6",
 "data": [
 // array payload objects 
 ]
}
  • matchCount: The total count of items matching the query parameters across all pages.
  • nextToken: The cursor mapping to the next page of items. If this physical string returns null, you have reached the absolute end of the list intelligently.
To pull the next batch, append the returned token to your next request: ?token=A1B2C3D4E5F6.