Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

stats

Retrieve statistics for all indexes or a specific index in Meilisearch to monitor performance and track data metrics.

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

  • The handler function for the 'stats' tool that fetches statistics from the Meilisearch API (/stats for all indexes or /indexes/{indexUid}/stats for specific index) and returns formatted JSON response or error.
    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);
      }
    }
  • Input schema validating the optional indexUid parameter using Zod.
    {
      indexUid: z.string().optional().describe('Unique identifier of the index (optional, if not provided stats for all indexes will be returned)'),
    },
  • Direct registration of the 'stats' tool on the MCP server within the registerSystemTools function, including name, description, schema, and handler.
    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)
    Invocation of registerSystemTools on the main MCP server instance, which registers the 'stats' tool among other system tools.
    registerSystemTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states it 'gets statistics' which implies a read-only operation, but doesn't disclose what statistics are returned, whether there are rate limits, authentication requirements, or any behavioral constraints. For a tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what statistics are returned, their format, or any behavioral aspects. Given the complexity of statistical data and complete lack of structured output information, this leaves the agent with significant uncertainty about what to expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the optional 'indexUid' parameter. The description mentions 'all indexes or a specific index' which aligns with the schema but adds no additional semantic context beyond what's already in the parameter description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get statistics') and resource ('about all indexes or a specific index'), making the purpose immediately understandable. It doesn't explicitly distinguish from siblings like 'get-index' or 'list-indexes', but the statistical focus is reasonably distinct from those listing operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools like 'get-index', 'list-indexes', and 'get-tasks', there's no indication of when statistical data is preferred over basic metadata or task information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/OrionPotter/iflow-mcp_meilisearch-ts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server