delete-index
Remove a Meilisearch index by its unique identifier to manage search data and free up resources.
Instructions
Delete a Meilisearch index
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexUid | Yes | Unique identifier of the index to delete |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"indexUid": {
"description": "Unique identifier of the index to delete",
"type": "string"
}
},
"required": [
"indexUid"
],
"type": "object"
}
Implementation Reference
- src/tools/index-tools.ts:143-152 (handler)The async handler function that performs the actual deletion of the specified Meilisearch index using the apiClient.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 schema defining the input parameters for the 'delete-index' tool.{ indexUid: z.string().describe('Unique identifier of the index to delete'), },
- src/tools/index-tools.ts:137-153 (registration)MCP server.tool registration for the 'delete-index' tool, including description, schema, and 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/tools/index-tools.ts:33-35 (schema)TypeScript type definition for the parameters used in the delete-index handler.interface DeleteIndexParams { indexUid: string; }
- src/index.ts:64-64 (registration)Top-level call to register all index tools, including 'delete-index', on the MCP server.registerIndexTools(server);