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, },

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