list_indices
Retrieve all indices available in your Elasticsearch cluster to understand your data structure and identify which indices to query or manage.
Instructions
List all indices in the Elasticsearch cluster.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/elastic_tool.py:39-47 (handler)The handler function that lists all non-system indices in the Elasticsearch cluster by fetching aliases and filtering out dot-prefixed names.def list_indices() -> list: """List all indices in the Elasticsearch cluster.""" try: indices = es.indices.get_alias() filtered = [name for name in indices.keys() if not name.startswith('.')] return filtered except Exception as e: logger.error(f"Error listing indices: {e}") return []
- tools/elastic_tool.py:38-38 (registration)Registers the list_indices tool using the FastMCP @mcp.tool() decorator, which uses the function name as the tool name.@mcp.tool()