Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

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
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • 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); } }
  • Input schema for the 'get-pagination' tool, requiring an 'indexUid' string parameter.
    { indexUid: z.string().describe("Unique identifier of the index"), },
  • 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", },
  • 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); } } ); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OrionPotter/iflow-mcp_meilisearch-ts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server