Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

delete-all-documents

Remove all documents from a specified Meilisearch index to clear data or reset content, ensuring precise index management through the Meilisearch MCP Server.

Instructions

Delete all documents in a Meilisearch index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • Handler function that deletes all documents from the specified Meilisearch index by calling the API delete endpoint.
    async ({ indexUid }: DeleteAllDocumentsParams) => { try { const response = await apiClient.delete(`/indexes/${indexUid}/documents`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
  • Zod input schema validating the indexUid parameter for the tool.
    { indexUid: z.string().describe('Unique identifier of the index'), },
  • MCP server.tool registration for the 'delete-all-documents' tool, including name, description, schema, and handler.
    server.tool( 'delete-all-documents', 'Delete all documents in a Meilisearch index', { indexUid: z.string().describe('Unique identifier of the index'), }, async ({ indexUid }: DeleteAllDocumentsParams) => { try { const response = await apiClient.delete(`/indexes/${indexUid}/documents`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
  • TypeScript interface defining parameters for the delete-all-documents handler.
    interface DeleteAllDocumentsParams { indexUid: string; }
  • src/index.ts:65-65 (registration)
    Invocation of document tools registration function which includes the delete-all-documents tool.
    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