Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

update-index

Modify a Meilisearch index by changing its primary key to organize data more effectively for 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 core handler function for the 'update-index' tool. It performs a PATCH request to the Meilisearch API to update the primary key of the specified index and returns the JSON response or an error message.
    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);
      }
    }
  • Zod input schema for the 'update-index' tool, defining the required parameters: indexUid and primaryKey.
    {
      indexUid: z.string().describe('Unique identifier of the index'),
      primaryKey: z.string().describe('New primary key for the index'),
    },
  • MCP tool registration for 'update-index', including name, description, schema, and handler 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 which registers the 'update-index' tool (among others) on the main MCP server instance.
    registerIndexTools(server);
  • TypeScript interface defining the input parameters for the update-index tool handler.
    interface UpdateIndexParams {
      indexUid: string;
      primaryKey: string;
    }
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. It mentions the tool updates an index, implying mutation, but doesn't disclose behavioral traits such as whether this operation is destructive, requires specific permissions, has side effects (e.g., reindexing), or what happens on failure. The 'currently only supports' note adds some context about limitations, but overall, critical behavioral details are missing for a mutation tool.

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 purpose and includes a useful limitation note. Every word earns its place, with no redundancy or unnecessary elaboration, making it easy to parse quickly.

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

Completeness3/5

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

Given the tool's complexity (a mutation operation with 2 parameters), lack of annotations, and no output schema, the description is minimally adequate. It states what the tool does and its current limitation, but doesn't cover behavioral aspects, error handling, or return values. For a mutation tool without annotations, more context would be beneficial to ensure safe and correct usage.

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 doesn't add any parameter-specific information beyond what's in the schema, such as format examples or constraints. Since the schema does the heavy lifting, 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.

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 a Meilisearch index') and specifies the resource being modified. It distinguishes this tool from other update tools by explicitly stating 'currently only supports updating the primary key,' which helps differentiate it from siblings like update-documents or update-settings. However, it doesn't fully distinguish from all siblings (e.g., update-index vs. create-index could use more contrast).

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

Usage Guidelines3/5

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

The description implies usage context by stating 'currently only supports updating the primary key,' suggesting this is for modifying index configuration rather than data. However, it doesn't provide explicit guidance on when to use this versus alternatives like create-index (for initial setup) or other update-* tools for different settings. No exclusions or prerequisites are mentioned.

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/OrionPotter/iflow-mcp_meilisearch-ts-mcp'

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