pause_dag
Pause an Airflow DAG to prevent scheduling new runs, useful for maintenance or debugging workflows.
Instructions
[Tool Role]: Pauses the specified Airflow DAG (prevents scheduling new runs).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dag_id | Yes |
Implementation Reference
- The pause_dag tool handler: pauses the Airflow DAG by sending a PATCH request to /dags/{dag_id} with {"is_paused": True}. Includes @mcp.tool() decorator for MCP registration and input validation.@mcp.tool() async def pause_dag(dag_id: str) -> Dict[str, Any]: """[Tool Role]: Pauses the specified Airflow DAG (prevents scheduling new runs).""" if not dag_id: raise ValueError("dag_id must not be empty") resp = await airflow_request("PATCH", f"/dags/{dag_id}", json={"is_paused": True}) resp.raise_for_status() dag_data = resp.json() return { "dag_id": dag_id, "is_paused": dag_data.get("is_paused") }
- src/mcp_airflow_api/tools/v1_tools.py:20-23 (registration)Registration of common tools (including pause_dag) for Airflow API v1 by setting v1-specific airflow_request and calling register_common_tools(mcp).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:21-24 (registration)Registration of common tools (including pause_dag) for Airflow API v2 by setting v2-specific airflow_request and calling register_common_tools(mcp).common_tools.airflow_request = airflow_request_v2 # Register all 43 common tools common_tools.register_common_tools(mcp)