Skip to main content
Glama
meilisearch

Meilisearch MCP Server

Official
by meilisearch

list-indexes

Retrieve all indexes from a Meilisearch server to manage and organize search data efficiently. Ideal for maintaining structured search environments.

Instructions

List all Meilisearch indexes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'list-indexes' tool in the list_tools handler, including its name, description, and input schema (empty object).
    types.Tool( name="list-indexes", description="List all Meilisearch indexes", inputSchema={ "type": "object", "properties": {}, "additionalProperties": False, }, ),
  • The MCP tool handler for 'list-indexes' which retrieves indexes using the client and returns formatted JSON output.
    elif name == "list-indexes": indexes = self.meili_client.get_indexes() formatted_json = json.dumps( indexes, indent=2, default=json_serializer ) return [ types.TextContent( type="text", text=f"Indexes:\n{formatted_json}" ) ]
  • Helper method in MeilisearchClient that fetches indexes from the Meilisearch library client and serializes them into a JSON-friendly dictionary format.
    def get_indexes(self) -> Dict[str, Any]: """Get all indexes""" indexes = self.client.get_indexes() # Convert Index objects to serializable dictionaries serialized_indexes = [] for index in indexes["results"]: serialized_indexes.append( { "uid": index.uid, "primaryKey": index.primary_key, "createdAt": index.created_at, "updatedAt": index.updated_at, } ) return { "results": serialized_indexes, "offset": indexes["offset"], "limit": indexes["limit"], "total": indexes["total"], }

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