list_indices
Retrieve all indices from an Elasticsearch cluster to view available data collections for querying and management.
Instructions
List all indices in the Elasticsearch cluster.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/elastic_tool.py:38-47 (handler)The handler function for the 'list_indices' tool. It lists all non-hidden indices in the Elasticsearch cluster by fetching aliases and filtering out those starting with '.'.@mcp.tool() 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 []