delete-index
Remove a Meilisearch index by its unique identifier to manage search data and free storage space.
Instructions
Delete a Meilisearch index
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexUid | Yes | Unique identifier of the index to delete |
Implementation Reference
- src/tools/index-tools.ts:143-152 (handler)The handler function that performs the actual deletion of the Meilisearch index via the API client, handles errors, and returns the response.async ({ indexUid }: DeleteIndexParams) => { try { const response = await apiClient.delete(`/indexes/${indexUid}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/index-tools.ts:140-142 (schema)Zod input schema defining the required 'indexUid' parameter for the delete-index tool.{ indexUid: z.string().describe('Unique identifier of the index to delete'), },
- src/tools/index-tools.ts:137-153 (registration)Registers the 'delete-index' tool with the MCP server using server.tool(), including name, description, schema, and handler function.server.tool( 'delete-index', 'Delete a Meilisearch index', { indexUid: z.string().describe('Unique identifier of the index to delete'), }, async ({ indexUid }: DeleteIndexParams) => { try { const response = await apiClient.delete(`/indexes/${indexUid}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
- src/index.ts:64-64 (registration)Top-level call to register all index management tools (including delete-index) to the main MCP server instance.registerIndexTools(server);
- src/tools/index-tools.ts:33-35 (helper)TypeScript interface defining the parameters for the delete-index tool handler.interface DeleteIndexParams { indexUid: string; }