Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

get-documents

Retrieve documents from a Meilisearch index using filters, pagination, and field selection to access specific data.

Instructions

Get documents from a Meilisearch index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index
limitNoMaximum number of documents to return (default: 20)
offsetNoNumber of documents to skip (default: 0)
fieldsNoFields to return in the documents
filterNoFilter query to apply

Implementation Reference

  • Handler function that performs a GET request to retrieve documents from a Meilisearch index using the apiClient, with support for pagination (limit/offset), field selection, and filtering. Returns the response as formatted JSON or an error.
    async ({ indexUid, limit, offset, fields, filter }: GetDocumentsParams) => {
      try {
        const response = await apiClient.get(`/indexes/${indexUid}/documents`, {
          params: {
            limit,
            offset,
            fields: fields?.join(','),
            filter,
          },
        });
        return {
          content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
        };
      } catch (error) {
        return createErrorResponse(error);
      }
    }
  • Zod schema defining the input parameters for the get-documents tool, including required indexUid and optional pagination, fields, and filter parameters.
    {
      indexUid: z.string().describe('Unique identifier of the index'),
      limit: z.number().min(1).max(1000).optional().describe('Maximum number of documents to return (default: 20)'),
      offset: z.number().min(0).optional().describe('Number of documents to skip (default: 0)'),
      fields: z.array(z.string()).optional().describe('Fields to return in the documents'),
      filter: z.string().optional().describe('Filter query to apply'),
    },
  • Direct registration of the 'get-documents' tool on the MCP server, specifying name, description, input schema, and handler function.
      'get-documents',
      'Get documents from a Meilisearch index',
      {
        indexUid: z.string().describe('Unique identifier of the index'),
        limit: z.number().min(1).max(1000).optional().describe('Maximum number of documents to return (default: 20)'),
        offset: z.number().min(0).optional().describe('Number of documents to skip (default: 0)'),
        fields: z.array(z.string()).optional().describe('Fields to return in the documents'),
        filter: z.string().optional().describe('Filter query to apply'),
      },
      async ({ indexUid, limit, offset, fields, filter }: GetDocumentsParams) => {
        try {
          const response = await apiClient.get(`/indexes/${indexUid}/documents`, {
            params: {
              limit,
              offset,
              fields: fields?.join(','),
              filter,
            },
          });
          return {
            content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
          };
        } catch (error) {
          return createErrorResponse(error);
        }
      }
    );
  • src/index.ts:65-65 (registration)
    Invocation of registerDocumentTools during MCP server initialization, which registers the get-documents tool among others.
    registerDocumentTools(server);
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose whether this is a read-only operation, potential side effects, rate limits, authentication needs, or return format, which are critical for a tool with 5 parameters and no output schema.

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 with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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?

Given the complexity (5 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain what 'Get documents' entails (e.g., retrieval method, pagination behavior, or result format), leaving significant gaps for the agent to infer usage.

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 fully documents all 5 parameters. The description adds no additional meaning beyond the schema, such as explaining interactions between parameters or usage examples. This meets the baseline for high schema coverage.

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

Purpose3/5

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

The description states the action ('Get documents') and resource ('from a Meilisearch index'), providing a basic purpose. However, it doesn't differentiate from similar siblings like 'get-document' (singular) or 'search', making it vague about scope or method compared to alternatives.

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?

No guidance is provided on when to use this tool versus alternatives such as 'search' or 'get-document'. The description lacks context about use cases, prerequisites, or exclusions, leaving the agent without direction for tool selection.

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