get-health-status
Retrieve comprehensive health status details for Meilisearch, enabling proactive monitoring and troubleshooting through the Meilisearch MCP Server.
Instructions
Get comprehensive health status of Meilisearch
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/meilisearch_mcp/server.py:675-683 (handler)The MCP tool handler in the call_tool function that executes get-health-status by calling the monitoring manager's get_health_status method and formatting the result as text content.elif name == "get-health-status": status = self.meili_client.monitoring.get_health_status() self.logger.info("Health status checked", status=status.__dict__) return [ types.TextContent( type="text", text=f"Health status: {json.dumps(status.__dict__, default=json_serializer)}", ) ]
- src/meilisearch_mcp/server.py:339-347 (registration)Registration of the get-health-status tool in the list_tools handler, including its name, description, and input schema.types.Tool( name="get-health-status", description="Get comprehensive health status of Meilisearch", inputSchema={ "type": "object", "properties": {}, "additionalProperties": False, }, ),
- Helper function in MonitoringManager that implements the core logic for retrieving comprehensive health status from Meilisearch, aggregating stats and index information.def get_health_status(self) -> HealthStatus: """Get comprehensive health status""" try: # Get various stats to build health picture stats = self.client.get_all_stats() indexes = self.client.get_indexes() indexes_info = [] for index in indexes: index_stats = self.client.index(index.uid).get_stats() indexes_info.append( { "uid": index.uid, "documents_count": index_stats["numberOfDocuments"], "is_indexing": index_stats["isIndexing"], } ) return HealthStatus( is_healthy=True, database_size=stats["databaseSize"], last_update=datetime.fromisoformat( stats["lastUpdate"].replace("Z", "+00:00") ), indexes_count=len(indexes), indexes_info=indexes_info, ) except Exception as e: raise Exception(f"Failed to get health status: {str(e)}")