Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

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
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index to delete

Implementation Reference

  • 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); } }
  • 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'), },
  • TypeScript interface DeleteIndexParams defining the input parameters for the delete-index handler.
    interface DeleteIndexParams { indexUid: string; }
  • 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);

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