Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

reset-pagination

Reset pagination settings to default values for a Meilisearch index to restore standard search result display.

Instructions

Reset the pagination setting to its default value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • Shared handler function for all reset-* tools, including reset-pagination. It deletes the specific settings endpoint (/indexes/{indexUid}/settings/pagination) via apiClient to reset to default values.
    async ({ indexUid }) => {
      try {
        const response = await apiClient.delete(`/indexes/${indexUid}/settings/${endpoint}`);
        return {
          content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }],
        };
      } catch (error) {
        return createErrorResponse(error);
      }
    }
  • Input schema for reset-pagination tool: requires indexUid as string.
    {
      indexUid: z.string().describe("Unique identifier of the index"),
    },
  • Configuration entry in resetSettingsTools array defining the name, endpoint, and description for the reset-pagination tool.
    {
      name: "reset-pagination",
      endpoint: "pagination",
      description: "Reset the pagination setting to its default value",
    },
  • Loop that dynamically registers the reset-pagination tool (and others) on the MCP server using server.tool() with the configuration from the array.
    resetSettingsTools.forEach(({ name, endpoint, description }) => {
      server.tool(
        name,
        description,
        {
          indexUid: z.string().describe("Unique identifier of the index"),
        },
        async ({ indexUid }) => {
          try {
            const response = await apiClient.delete(`/indexes/${indexUid}/settings/${endpoint}`);
            return {
              content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }],
            };
          } catch (error) {
            return createErrorResponse(error);
          }
        }
      );
    });
  • src/index.ts:67-67 (registration)
    Top-level call to registerSettingsTools(server) which registers all settings tools including reset-pagination.
    registerSettingsTools(server);

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