Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

get-distinct-attribute

Retrieve the distinct attribute setting for a Meilisearch index to manage how duplicate values are handled in search results.

Instructions

Get the distinct attribute setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • Handler function that executes the tool logic: fetches the 'distinct-attribute' setting from Meilisearch API for the given index and returns JSON 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);
      }
    }
  • Input schema using Zod: requires 'indexUid' string parameter.
    {
      indexUid: z.string().describe("Unique identifier of the index"),
    },
  • Dynamic registration of the 'get-distinct-attribute' tool via loop over specificSettingsTools array, using server.tool(name, description, schema, handler).
    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);
          }
        }
      );
    });
  • Configuration entry in specificSettingsTools array defining name, endpoint, and description for the tool.
    {
      name: "get-distinct-attribute",
      endpoint: "distinct-attribute",
      description: "Get the distinct attribute setting",
    },
  • src/index.ts:67-67 (registration)
    Top-level call to registerSettingsTools on the main MCP server instance, which includes registration of get-distinct-attribute.
    registerSettingsTools(server);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the action ('Get'), implying a read-only operation, but fails to detail aspects like authentication needs, rate limits, error conditions, or the format of the returned setting. This leaves significant gaps in understanding how the tool behaves.

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

Conciseness3/5

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

The description is a single, concise sentence, but it is under-specified rather than efficiently informative. It lacks front-loaded critical details, such as clarifying what 'distinct attribute' means in this context, reducing its effectiveness despite brevity.

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 managing index settings and the absence of both annotations and an output schema, the description is incomplete. It does not explain what a 'distinct attribute setting' is, how it's used, or what the return value looks like, making it inadequate for an agent to use the tool effectively 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 input schema has 100% description coverage, with 'indexUid' clearly documented as 'Unique identifier of the index'. The description adds no additional meaning beyond this, as it does not mention parameters at all. According to guidelines, a baseline score of 3 is appropriate when schema coverage is high (>80%).

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

Purpose2/5

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

The description 'Get the distinct attribute setting' restates the tool name with minimal elaboration, making it a tautology. It specifies a verb ('Get') and resource ('distinct attribute setting'), but lacks specificity about what this setting entails or how it differs from related tools like 'reset-distinct-attribute' or 'update-distinct-attribute'.

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 does not mention prerequisites, context, or comparisons to sibling tools such as 'get-settings' (which might include this attribute) or 'reset-distinct-attribute', leaving the agent without 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