Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

delete-all-documents

Remove all documents from a Meilisearch index to clear data or reset content for testing and maintenance purposes.

Instructions

Delete all documents in a Meilisearch index

Input Schema

NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "indexUid": { "description": "Unique identifier of the index", "type": "string" } }, "required": [ "indexUid" ], "type": "object" }

Implementation Reference

  • Executes the deletion of all documents in the specified Meilisearch index via API call and handles response or error.
    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); } }
  • Type definition for the input parameters of the delete-all-documents tool.
    interface DeleteAllDocumentsParams { indexUid: string; }
  • Zod schema for input validation of the tool.
    { indexUid: z.string().describe('Unique identifier of the index'), },
  • Registers the delete-all-documents tool with the MCP server, providing name, description, input 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); } } );
  • src/index.ts:65-65 (registration)
    Invokes the document tools registration function in the main MCP server setup, which includes delete-all-documents.
    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/OrionPotter/iflow-mcp_meilisearch-ts-mcp'

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