Skip to main content
Glama
meilisearch

Meilisearch MCP Server

Official
by meilisearch

get-documents

Retrieve documents from a specified Meilisearch index using indexUid, with optional offset and limit parameters for precise data extraction.

Instructions

Get documents from an index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYes
limitNo
offsetNo

Implementation Reference

  • Handler function for the 'get-documents' tool within the MCP tool dispatcher. Fetches documents from the specified index using MeilisearchClient, applies default offset/limit, serializes to JSON, and returns as text content.
    elif name == "get-documents":
        # Use default values to fix None parameter issues (related to issue #17)
        offset = arguments.get("offset", 0)
        limit = arguments.get("limit", 20)
        documents = self.meili_client.documents.get_documents(
            arguments["indexUid"],
            offset,
            limit,
        )
        # Convert DocumentsResults object to proper JSON format (fixes issue #16)
        formatted_json = json.dumps(
            documents, indent=2, default=json_serializer
        )
        return [
            types.TextContent(
                type="text", text=f"Documents:\n{formatted_json}"
            )
        ]
  • Registration of the 'get-documents' tool in the list_tools handler, including name, description, and input schema definition.
    types.Tool(
        name="get-documents",
        description="Get documents from an index",
        inputSchema={
            "type": "object",
            "properties": {
                "indexUid": {"type": "string"},
                "offset": {"type": "integer"},
                "limit": {"type": "integer"},
            },
            "required": ["indexUid"],
            "additionalProperties": False,
        },
    ),
  • Input schema for the 'get-documents' tool, defining required indexUid and optional offset/limit parameters.
        "type": "object",
        "properties": {
            "indexUid": {"type": "string"},
            "offset": {"type": "integer"},
            "limit": {"type": "integer"},
        },
        "required": ["indexUid"],
        "additionalProperties": False,
    },
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 if this is read-only, requires authentication, has rate limits, or describes output format (e.g., pagination, error handling). This is inadequate for a tool with 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.

Conciseness4/5

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

The description is concise with a single sentence, but it's under-specified rather than efficiently informative. It's front-loaded but lacks necessary detail, making it lean at the cost of clarity.

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 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't cover parameter meanings, behavioral traits, or return values, leaving significant gaps for an AI agent to understand and invoke the tool correctly.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'indexUid', 'limit', or 'offset' mean, their expected formats, or how they affect behavior (e.g., pagination). This leaves parameters undocumented beyond the schema.

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 'Get documents from an index' states a clear verb ('Get') and resource ('documents'), but it's vague about scope and doesn't distinguish from siblings like 'search' or 'list-indexes'. It lacks specificity about what 'Get' entails (e.g., retrieval, listing, or fetching).

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' (for querying) or 'list-indexes' (for index metadata). The description implies usage for document retrieval but offers no context on prerequisites, exclusions, or comparisons with sibling tools.

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

Related 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/meilisearch/meilisearch-mcp'

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