get_cluster_health
Check the health status of an OpenSearch cluster to monitor its operational state and identify potential issues.
Instructions
Get cluster health status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'get_cluster_health' tool. It retrieves the OpenSearch cluster health status using the es_client and returns it as a list of TextContent.@mcp.tool(description="Get cluster health status") async def get_cluster_health() -> list[TextContent]: """ Get health status of the Opensearch cluster. Returns information about the number of nodes, shards, etc. """ self.logger.info("Getting cluster health") try: response = self.es_client.cluster.health() return [TextContent(type="text", text=str(response))] except Exception as e: self.logger.error(f"Error getting cluster health: {e}") return [TextContent(type="text", text=f"Error: {str(e)}")]