Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

delete-document

Remove a specific document from a Meilisearch index by providing its unique ID and the index identifier to manage data efficiently within the search engine.

Instructions

Delete a document by its ID from a Meilisearch index

Input Schema

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

Implementation Reference

  • The handler function that performs the actual deletion by sending a DELETE request to the Meilisearch API endpoint for the specified index and document ID.
    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); } }
  • Registers the 'delete-document' tool with the MCP server using server.tool(), including name, description, Zod input schema, and inline handler function.
    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); } } );
  • Zod schema for validating the input parameters: indexUid (string) and documentId (string).
    { indexUid: z.string().describe('Unique identifier of the index'), documentId: z.string().describe('ID of the document to delete'), },
  • TypeScript interface defining the parameter types used in the handler signature.
    interface DeleteDocumentParams { indexUid: string; documentId: string; }
  • src/index.ts:65-65 (registration)
    Invokes registerDocumentTools to register all document management tools, including 'delete-document', with the main MCP server instance.
    registerDocumentTools(server);

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