get_dag_stats
Retrieve statistics for Apache Airflow DAGs to monitor workflow performance and status.
Instructions
Get DAG stats
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_dag_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dag_ids | No |
Implementation Reference
- src/airflow/dagstats.py:18-27 (handler)The asynchronous handler function that implements the core logic of the 'get_dag_stats' tool by calling the Airflow DagStatsApi and returning the response as text content.
async def get_dag_stats( dag_ids: Optional[List[str]] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: # Build parameters dictionary kwargs: Dict[str, Any] = {} if dag_ids is not None: kwargs["dag_ids"] = dag_ids response = dag_stats_api.get_dag_stats(**kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))] - src/airflow/dagstats.py:11-16 (registration)The get_all_functions function that returns the registration details (function, name, description, read-only flag) for the 'get_dag_stats' tool, imported and used in src/main.py for tool registration.
def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (get_dag_stats, "get_dag_stats", "Get DAG stats", True), ]