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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.py:10-13 (handler)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()
- src/clients/common/index.py:6-8 (helper)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)