all_dag_event_summary
Retrieve event count summaries for all DAGs in Apache Airflow clusters to monitor workflow activity and analyze event data across pipelines quickly.
Instructions
[Tool Role]: Retrieves event count summary for all DAGs.
Returns: Summary of event counts by DAG: dag_summaries, total_dags, total_events
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler function for the 'all_dag_event_summary' tool. It fetches the most recent 1000 event logs from the Airflow API and generates a summary dictionary counting events by DAG ID and event type.@mcp.tool() async def all_dag_event_summary() -> Dict[str, Any]: """[Tool Role]: Provides summary of event logs across all DAGs.""" resp = await airflow_request("GET", "/eventLogs?limit=1000") resp.raise_for_status() data = resp.json() event_summary = {} for event in data.get("event_logs", []): dag_id = event.get("dag_id", "unknown") event_type = event.get("event", "unknown") if dag_id not in event_summary: event_summary[dag_id] = {} if event_type not in event_summary[dag_id]: event_summary[dag_id][event_type] = 0 event_summary[dag_id][event_type] += 1 return { "event_summary": event_summary, "total_events": len(data.get("event_logs", [])), "unique_dags": len(event_summary) }
- src/mcp_airflow_api/tools/v1_tools.py:23-23 (registration)Registration of common tools (including all_dag_event_summary) for Airflow API v1 by calling register_common_tools.common_tools.register_common_tools(mcp)
- src/mcp_airflow_api/tools/v2_tools.py:24-24 (registration)Registration of common tools (including all_dag_event_summary) for Airflow API v2 by calling register_common_tools.common_tools.register_common_tools(mcp)