Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

get-ranking-rules

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

Instructions

Get the ranking rules setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • Handler function that fetches the ranking rules setting from the Meilisearch API endpoint `/indexes/${indexUid}/settings/ranking-rules` and returns the JSON-formatted response or an error.
    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 defining the required 'indexUid' parameter as a string.
    {
      indexUid: z.string().describe("Unique identifier of the index"),
    },
  • Configuration object in the specificSettingsTools array that defines the tool name, endpoint, and description for registration.
    {
      name: "get-ranking-rules",
      endpoint: "ranking-rules",
      description: "Get the ranking rules setting",
    },
  • forEach loop that registers the server.tool for 'get-ranking-rules' and other specific settings tools using the shared schema and handler.
    // 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);
          }
        }
      );
    });
  • src/index.ts:67-67 (registration)
    Top-level call to registerSettingsTools which includes the registration of the 'get-ranking-rules' tool.
    registerSettingsTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does ('Get'), implying a read operation, but doesn't add context like authentication needs, rate limits, or what 'ranking rules' entail. This leaves significant gaps in understanding the tool's behavior beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool and front-loaded with the core action, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a retrieval tool with no annotations and no output schema, the description is incomplete. It lacks details on what 'ranking rules' are, the format of the return value, or any behavioral context, making it insufficient for an agent to fully understand the tool's use without external knowledge.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the input schema fully documents the single parameter 'indexUid'. The description adds no additional meaning beyond what the schema provides, such as explaining what 'ranking rules' are or how they relate to the index. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get the ranking rules setting' clearly states the verb ('Get') and resource ('ranking rules setting'), which is a specific action. However, it doesn't distinguish this tool from similar siblings like 'get-settings' or 'get-sortable-attributes', which also retrieve settings, leaving the purpose somewhat vague in context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, when this is appropriate compared to other 'get-' tools, or any contextual constraints, leaving the agent with no usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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