delete-index
Remove a specific index from Meilisearch by providing its unique identifier, ensuring efficient index management and organization within the Meilisearch MCP Server.
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 main handler function for the 'delete-index' tool. It sends a DELETE request to the Meilisearch API at `/indexes/${indexUid}` using apiClient and returns the response or handles errors with createErrorResponse.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 for the 'delete-index' tool, requiring 'indexUid' as a string with description.{ indexUid: z.string().describe('Unique identifier of the index to delete'), },
- src/tools/index-tools.ts:33-35 (schema)TypeScript interface DeleteIndexParams defining the input parameters for the delete-index handler.interface DeleteIndexParams { indexUid: string; }
- src/tools/index-tools.ts:137-153 (registration)The server.tool registration block for the 'delete-index' tool, including name, description, schema, and inline handler.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 registerIndexTools(server), which includes the registration of the 'delete-index' tool.registerIndexTools(server);