get_collection_items
Retrieve items from a collection with pagination, sorting, filtering, and relation population.
Instructions
Liste les items d'une collection avec pagination, tri, filtres et populate
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection | Yes | Nom de la collection | |
| page | No | Numéro de page (défaut: 1) | |
| perPage | No | Items par page (défaut: 20, max: 100) | |
| sort | No | Champ de tri. Préfixe - pour descendant (ex: -created_at) | |
| populate | No | Relations à inclure, séparées par des virgules (ex: author,category) | |
| filters | No | Filtres JSON (ex: { status: 'active' }) |
Implementation Reference
- src/index.ts:55-72 (handler)Handler case in the MCP request dispatcher that extracts arguments (collection, page, perPage, sort, populate, filters) and delegates to skema.getItems()
case "get_collection_items": { const { collection, page, perPage, sort, populate, filters } = args as { collection: string; page?: number; perPage?: number; sort?: string; populate?: string; filters?: Record<string, unknown>; }; result = await skema.getItems(collection, { page, perPage, sort, populate, filters, }); break; } - src/skema-client.ts:82-99 (helper)Helper function that calls the remote MCP API via JSON-RPC with the 'get_collection_items' tool name
export const getItems = ( collection: string, options?: { page?: number; perPage?: number; sort?: string; populate?: string; filters?: Record<string, unknown>; } ) => mcpCall("get_collection_items", { collection, page: options?.page, perPage: options?.perPage, sort: options?.sort, populate: options?.populate, filters: options?.filters, }); - src/tools.ts:33-65 (schema)Tool registration with inputSchema defining the parameters: collection (required), page, perPage, sort, populate, filters (optional)
name: "get_collection_items", description: "Liste les items d'une collection avec pagination, tri, filtres et populate", inputSchema: { type: "object", properties: { collection: { type: "string", description: "Nom de la collection", }, page: { type: "number", description: "Numéro de page (défaut: 1)", }, perPage: { type: "number", description: "Items par page (défaut: 20, max: 100)", }, sort: { type: "string", description: "Champ de tri. Préfixe - pour descendant (ex: -created_at)", }, populate: { type: "string", description: "Relations à inclure, séparées par des virgules (ex: author,category)", }, filters: { type: "object", description: "Filtres JSON (ex: { status: 'active' })", }, }, required: ["collection"], }, }, - src/tools.ts:32-33 (registration)Registration of the 'get_collection_items' tool in the tools array used by ListToolsRequestHandler
{ name: "get_collection_items",