Skip to main content
Glama
cr7258

Elasticsearch MCP Server

list_indices

Retrieve all index names from an Elasticsearch cluster to view available data collections for search and management operations.

Instructions

List all indices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_indices' MCP tool. It is decorated with @mcp.tool() for registration and executes by calling the search client's list_indices method.
    @mcp.tool() def list_indices() -> List[Dict]: """List all indices.""" return self.search_client.list_indices()
  • The underlying helper method in IndexClient that implements the core logic by calling the search client's cat.indices() API.
    def list_indices(self) -> Dict: """List all indices.""" return self.client.cat.indices()
  • src/server.py:44-53 (registration)
    Registration of IndexTools class in the server, which leads to instantiation and calling register_tools(mcp), applying the @mcp.tool() decorators including for list_indices.
    tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ] # Register all tools register.register_all_tools(tool_classes)

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/cr7258/elasticsearch-mcp-server'

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