Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

update-index

Modify a Meilisearch index's primary key to ensure accurate document identification and retrieval within search operations.

Instructions

Update a Meilisearch index (currently only supports updating the primary key)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index
primaryKeyYesNew primary key for the index

Implementation Reference

  • The handler function that implements the logic for the 'update-index' tool by sending a PATCH request to update the primary key of the specified Meilisearch index.
    async ({ indexUid, primaryKey }: UpdateIndexParams) => {
      try {
        const response = await apiClient.patch(`/indexes/${indexUid}`, {
          primaryKey,
        });
        return {
          content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
        };
      } catch (error) {
        return createErrorResponse(error);
      }
    }
  • Type definition for the input parameters of the update-index tool.
    interface UpdateIndexParams {
      indexUid: string;
      primaryKey: string;
    }
  • Zod schema for validating the input parameters of the 'update-index' tool.
    {
      indexUid: z.string().describe('Unique identifier of the index'),
      primaryKey: z.string().describe('New primary key for the index'),
    },
  • Registration of the 'update-index' tool using server.tool() within the registerIndexTools function.
    server.tool(
      'update-index',
      'Update a Meilisearch index (currently only supports updating the primary key)',
      {
        indexUid: z.string().describe('Unique identifier of the index'),
        primaryKey: z.string().describe('New primary key for the index'),
      },
      async ({ indexUid, primaryKey }: UpdateIndexParams) => {
        try {
          const response = await apiClient.patch(`/indexes/${indexUid}`, {
            primaryKey,
          });
          return {
            content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
          };
        } catch (error) {
          return createErrorResponse(error);
        }
      }
    );
  • src/index.ts:64-64 (registration)
    Invocation of registerIndexTools on the main MCP server instance, which registers the 'update-index' tool among others.
    registerIndexTools(server);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool performs an update operation, implying mutation, but doesn't disclose behavioral traits such as permissions required, whether the update is reversible, side effects on existing data, or rate limits. The limitation about primary key support is useful but insufficient for a mutation tool with zero annotation coverage.

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 that front-loads the core action and includes a parenthetical limitation. Every word earns its place with no redundancy or waste, making it appropriately sized and well-structured for quick comprehension.

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 tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral context (e.g., safety, effects), usage prerequisites, and expected outcomes. While concise, it doesn't compensate for the missing structured data, leaving gaps for an AI agent to operate safely and effectively.

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?

Schema description coverage is 100%, with both parameters (indexUid, primaryKey) fully documented in the schema. The description adds no additional meaning about parameters beyond implying the primaryKey is the updatable field. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description provides minimal extra value.

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

Purpose4/5

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

The description clearly states the action ('Update') and resource ('a Meilisearch index'), and specifies the current capability ('currently only supports updating the primary key'). This distinguishes it from other update tools like update-documents or update-settings by limiting scope, though it doesn't explicitly name alternatives. The purpose is specific but could better differentiate from siblings.

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 like create-index or other update-* tools. The description mentions a limitation ('only supports updating the primary key'), which implies usage context but doesn't state when this operation is appropriate or what prerequisites exist. This leaves the agent without explicit usage rules.

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