Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

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

Implementation Reference

  • 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);
      }
    }
  • Zod input schema defining the required 'indexUid' parameter for the delete-index tool.
    {
      indexUid: z.string().describe('Unique identifier of the index to delete'),
    },
  • 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);
  • TypeScript interface defining the parameters for the delete-index tool handler.
    interface DeleteIndexParams {
      indexUid: string;
    }

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