Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

stats

Retrieve statistics for all or a specific index in Meilisearch to monitor performance and manage data effectively. Helps assess index health and optimize search operations.

Instructions

Get statistics about all indexes or a specific index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidNoUnique identifier of the index (optional, if not provided stats for all indexes will be returned)

Implementation Reference

  • Executes the 'stats' tool by calling the Meilisearch API at /stats or /indexes/{indexUid}/stats and returns the JSON response.
    async ({ indexUid }) => { try { const endpoint = indexUid ? `/indexes/${indexUid}/stats` : '/stats'; const response = await apiClient.get(endpoint); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
  • Zod input schema defining optional indexUid parameter for the 'stats' tool.
    indexUid: z.string().optional().describe('Unique identifier of the index (optional, if not provided stats for all indexes will be returned)'),
  • MCP server.tool registration for the 'stats' tool, including name, description, input schema, and handler function.
    server.tool( 'stats', 'Get statistics about all indexes or a specific index', { indexUid: z.string().optional().describe('Unique identifier of the index (optional, if not provided stats for all indexes will be returned)'), }, async ({ indexUid }) => { try { const endpoint = indexUid ? `/indexes/${indexUid}/stats` : '/stats'; const response = await apiClient.get(endpoint); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
  • src/index.ts:69-69 (registration)
    Top-level call to registerSystemTools on the MCP server instance, which registers the 'stats' tool among others.
    registerSystemTools(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