Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

delete-document

Remove a specific document from a Meilisearch index using its unique ID to maintain data accuracy and index cleanliness.

Instructions

Delete a document by its ID from a Meilisearch index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index
documentIdYesID of the document to delete

Implementation Reference

  • Handler function that performs the deletion of a document by ID from the specified Meilisearch index using the apiClient.
    async ({ indexUid, documentId }: DeleteDocumentParams) => {
      try {
        const response = await apiClient.delete(`/indexes/${indexUid}/documents/${documentId}`);
        return {
          content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
        };
      } catch (error) {
        return createErrorResponse(error);
      }
    }
  • Zod schema for input parameters of the delete-document tool: indexUid and documentId.
    {
      indexUid: z.string().describe('Unique identifier of the index'),
      documentId: z.string().describe('ID of the document to delete'),
    },
  • Registration of the 'delete-document' tool on the MCP server.
    server.tool(
      'delete-document',
      'Delete a document by its ID from a Meilisearch index',
      {
        indexUid: z.string().describe('Unique identifier of the index'),
        documentId: z.string().describe('ID of the document to delete'),
      },
      async ({ indexUid, documentId }: DeleteDocumentParams) => {
        try {
          const response = await apiClient.delete(`/indexes/${indexUid}/documents/${documentId}`);
          return {
            content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
          };
        } catch (error) {
          return createErrorResponse(error);
        }
      }
    );
  • TypeScript type definition for the parameters used in the delete-document handler.
    interface DeleteDocumentParams {
      indexUid: string;
      documentId: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool deletes a document, implying a destructive mutation, but doesn't clarify if deletion is permanent, reversible (e.g., via tasks), or has side effects. It also omits information about permissions, error handling, or response format, leaving significant gaps for a destructive operation.

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 that efficiently conveys the core action without unnecessary words. It's front-loaded with the verb 'Delete' and specifies the key resource and identifier, making it easy to parse. Every word serves a purpose, with no 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?

For a destructive tool with no annotations and no output schema, the description is incomplete. It lacks crucial details like whether the operation is synchronous/asynchronous, what happens on success/failure, or how it relates to Meilisearch's task system (implied by sibling tools like 'get-task'). Given the complexity of deletion in a search index context, more behavioral context is needed.

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 clearly documented in the schema. The description adds no additional parameter semantics beyond what's in the schema (e.g., format examples, constraints, or relationships). This meets the baseline of 3 since the schema adequately covers parameters, but the description doesn't enhance understanding.

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 ('Delete') and resource ('a document by its ID from a Meilisearch index'), making the purpose immediately understandable. It distinguishes this from sibling tools like 'delete-all-documents' or 'delete-documents' by specifying deletion of a single document by ID. However, it doesn't explicitly contrast with these alternatives in the text itself.

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?

The description provides no guidance on when to use this tool versus alternatives like 'delete-all-documents' or 'delete-documents'. It also doesn't mention prerequisites (e.g., whether the document must exist) or contextual constraints. The agent must infer usage from the tool name and parameters alone.

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