Skip to main content
Glama
meilisearch

Meilisearch MCP Server

Official
by meilisearch

create-index

Generates a new Meilisearch index by specifying a unique identifier (uid) and optional primary key, enabling efficient data organization and search functionality.

Instructions

Create a new Meilisearch index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
primaryKeyNo
uidYes

Implementation Reference

  • MCP tool handler for create-index: calls IndexManager.create_index with uid and optional primaryKey, returns success message with result.
    elif name == "create-index":
        result = self.meili_client.indexes.create_index(
            arguments["uid"], arguments.get("primaryKey")
        )
        return [
            types.TextContent(type="text", text=f"Created index: {result}")
        ]
  • Registration of the create-index tool in list_tools handler, including description and input schema requiring 'uid'.
    types.Tool(
        name="create-index",
        description="Create a new Meilisearch index",
        inputSchema={
            "type": "object",
            "properties": {
                "uid": {"type": "string"},
                "primaryKey": {"type": "string"},
            },
            "required": ["uid"],
            "additionalProperties": False,
        },
    ),
  • Input schema for create-index tool: object with required 'uid' string and optional 'primaryKey' string.
        "type": "object",
        "properties": {
            "uid": {"type": "string"},
            "primaryKey": {"type": "string"},
        },
        "required": ["uid"],
        "additionalProperties": False,
    },
  • IndexManager helper method wrapping Meilisearch Client.create_index for creating indexes.
    def create_index(
        self, uid: str, primary_key: Optional[str] = None
    ) -> Dict[str, Any]:
        """Create a new index"""
        try:
            return self.client.create_index(uid, {"primaryKey": primary_key})
        except Exception as e:
            raise Exception(f"Failed to create index: {str(e)}")
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 but offers minimal information. It states it's a creation operation, implying mutation, but doesn't cover permissions needed, whether it's idempotent, what happens on conflicts (e.g., if 'uid' already exists), rate limits, or the expected response format. This leaves significant gaps for an agent to understand the tool's behavior.

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, direct sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by conveying the essential purpose without redundancy or fluff.

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 creating a database index (a mutation operation), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't explain what the tool returns, error conditions, or how it integrates with the broader Meilisearch system (e.g., indexing tasks). More detail is needed for safe and effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description adds no information about the parameters 'uid' or 'primaryKey', such as what they represent, format constraints (e.g., 'uid' as a unique identifier), or how 'primaryKey' affects index behavior. This fails to compensate for the lack of schema documentation.

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 ('create') and resource ('Meilisearch index'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'delete-index' or 'list-indexes' beyond the obvious verb difference, missing an opportunity to clarify its unique role in the index lifecycle.

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. It doesn't mention prerequisites (e.g., whether an index must not already exist), relationships to other tools (e.g., that 'add-documents' might follow), or when to choose this over modifying existing indexes via settings. The description is purely declarative without contextual advice.

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

Related 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/meilisearch/meilisearch-mcp'

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