get_health
Check the health status of the Airflow webserver, including metadatabase and scheduler status, using the MCP-Airflow-API tool for cluster monitoring.
Instructions
[Tool Role]: Get the health status of the Airflow webserver instance.
Returns: Health status information including metadatabase and scheduler status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The primary handler function implementing the get_health tool. It dynamically selects the health check endpoint based on Airflow API version (v1 or v2) and returns the cluster health status.@mcp.tool() async def get_health() -> Dict[str, Any]: """[Tool Role]: Checks Airflow cluster health status.""" # Import here to avoid circular imports from ..functions import get_api_version api_version = get_api_version() if api_version == "v2": # v2 API: Use /monitor/health endpoint (Airflow 3.x) resp = await airflow_request("GET", "/monitor/health") else: # v1 API: Use /health endpoint (Airflow 2.x) resp = await airflow_request("GET", "/health") resp.raise_for_status() return resp.json()
- src/mcp_airflow_api/tools/v1_tools.py:19-23 (registration)v1-specific registration that configures the airflow_request function and calls register_common_tools(mcp), which applies the @mcp.tool() decorator to define/register get_health.# Set the global request function to v1 common_tools.airflow_request = airflow_request_v1 # Register all 56 common tools (includes management tools) common_tools.register_common_tools(mcp)
- src/mcp_airflow_api/tools/v2_tools.py:20-24 (registration)v2-specific registration that configures the airflow_request function and calls register_common_tools(mcp), which applies the @mcp.tool() decorator to define/register get_health.# Set the global request function to v2 common_tools.airflow_request = airflow_request_v2 # Register all 43 common tools common_tools.register_common_tools(mcp)
- src/mcp_airflow_api/mcp_main.py:264-266 (registration)Main entrypoint registration for v1 tools (conditional on API version), which ultimately registers get_health via v1_tools.register_tools.logger.info("Loading Airflow API v1 tools (Airflow 2.x)") from mcp_airflow_api.tools import v1_tools v1_tools.register_tools(mcp_instance)
- src/mcp_airflow_api/mcp_main.py:268-270 (registration)Main entrypoint registration for v2 tools (conditional on API version), which ultimately registers get_health via v2_tools.register_tools.logger.info("Loading Airflow API v2 tools (Airflow 3.0+)") from mcp_airflow_api.tools import v2_tools v2_tools.register_tools(mcp_instance)