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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_cluster_health"
}
}Input 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)}")]