get_cluster_stats
Retrieve a high-level overview of Elasticsearch cluster statistics to monitor health, performance, and resource usage for effective cluster management.
Instructions
Returns high-level overview of cluster statistics.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/cluster.py:14-17 (handler)The MCP tool handler for get_cluster_stats. This function is decorated with @mcp.tool() and delegates the execution to the search client's get_cluster_stats method.@mcp.tool() def get_cluster_stats() -> Dict: """Returns high-level overview of cluster statistics.""" return self.search_client.get_cluster_stats()
- src/clients/common/cluster.py:10-12 (helper)The supporting helper method in ClusterClient that performs the actual call to the OpenSearch client's cluster.stats() method to retrieve cluster statistics.def get_cluster_stats(self) -> Dict: """Get cluster statistics from OpenSearch.""" return self.client.cluster.stats()
- src/tools/cluster.py:8-18 (registration)The register_tools method in ClusterTools where the get_cluster_stats tool (among others) is registered with the FastMCP instance using the @mcp.tool() decorator.def register_tools(self, mcp: FastMCP): @mcp.tool() def get_cluster_health() -> Dict: """Returns basic information about the health of the cluster.""" return self.search_client.get_cluster_health() @mcp.tool() def get_cluster_stats() -> Dict: """Returns high-level overview of cluster statistics.""" return self.search_client.get_cluster_stats()