Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

reset-ranking-rules

Reset the ranking rules of a Meilisearch index to their default configuration, ensuring consistent search behavior by specifying the index's unique identifier.

Instructions

Reset the ranking rules setting to its default value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • Handler function that performs a DELETE request to `/indexes/{indexUid}/settings/ranking-rules` using apiClient to reset the ranking rules for the specified Meilisearch 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); } }
  • Input schema defining the required 'indexUid' parameter as a string.
    { indexUid: z.string().describe("Unique identifier of the index"), },
  • Configuration object in resetSettingsTools array that specifies the name, endpoint, and description for the 'reset-ranking-rules' tool, used in the dynamic registration loop.
    { name: "reset-ranking-rules", endpoint: "ranking-rules", description: "Reset the ranking rules setting to its default value", },
  • Dynamic registration loop in registerSettingsTools function that calls server.tool for each reset tool, including 'reset-ranking-rules', with inline schema and handler.
    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) in the main MCP server initialization, which registers all settings tools including 'reset-ranking-rules'.
    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/devlimelabs/meilisearch-ts-mcp'

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