get-pagination
Retrieve pagination configuration for a Meilisearch index to control how search results are divided into pages.
Instructions
Get the pagination setting
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexUid | Yes | Unique identifier of the index |
Implementation Reference
- src/tools/settings-tools.ts:155-164 (handler)Handler function that fetches the pagination settings from the Meilisearch API endpoint `/indexes/${indexUid}/settings/pagination` using the shared endpoint variable set to 'pagination' for this tool.async ({ indexUid }) => { try { const response = await apiClient.get(`/indexes/${indexUid}/settings/${endpoint}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/settings-tools.ts:152-154 (schema)Input schema for the 'get-pagination' tool, requiring an 'indexUid' string parameter.{ indexUid: z.string().describe("Unique identifier of the index"), },
- src/tools/settings-tools.ts:140-144 (registration)Configuration object in the specificSettingsTools array that defines the 'get-pagination' tool's name, endpoint ('pagination'), and description for dynamic registration via the forEach loop.{ name: "get-pagination", endpoint: "pagination", description: "Get the pagination setting", },
- src/tools/settings-tools.ts:147-166 (registration)Dynamic registration loop that registers the 'get-pagination' tool (and others) by calling server.tool with the configuration from the specificSettingsTools array.// Create a tool for each specific setting specificSettingsTools.forEach(({ name, endpoint, description }) => { server.tool( name, description, { indexUid: z.string().describe("Unique identifier of the index"), }, async ({ indexUid }) => { try { const response = await apiClient.get(`/indexes/${indexUid}/settings/${endpoint}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } ); });