Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

get-ranking-rules

Retrieve the ranking rules configuration for a Meilisearch index to understand how search results are ordered.

Instructions

Get the ranking rules setting

Input Schema

NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "indexUid": { "description": "Unique identifier of the index", "type": "string" } }, "required": [ "indexUid" ], "type": "object" }

Implementation Reference

  • Handler function that performs a GET request to the Meilisearch API for `/indexes/{indexUid}/settings/ranking-rules` (via ${endpoint}) and returns the JSON-formatted settings or error response.
    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); } }
  • Zod input schema requiring 'indexUid' parameter as a string, describing the Meilisearch index unique identifier.
    { indexUid: z.string().describe("Unique identifier of the index"), },
  • Dynamic registration of the 'get-ranking-rules' tool (name, description, schema, and handler provided via loop variables from specificSettingsTools config).
    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); } } );
  • Configuration object in specificSettingsTools array that defines the tool name 'get-ranking-rules', its API endpoint 'ranking-rules', and description for use in dynamic registration.
    { name: "get-ranking-rules", endpoint: "ranking-rules", description: "Get the ranking rules setting", },
  • src/index.ts:67-67 (registration)
    Top-level invocation of registerSettingsTools on the MCP server instance, which triggers registration of get-ranking-rules and other settings tools.
    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