pause_dag
Pause an Airflow DAG to prevent scheduling new runs, ensuring workflow control. Specify the DAG ID to halt execution and receive confirmation of the paused state.
Instructions
[Tool Role]: Pauses the specified Airflow DAG (prevents scheduling new runs).
Args: dag_id: The DAG ID to pause
Returns: Minimal info about the paused DAG: dag_id, is_paused
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dag_id | Yes |
Implementation Reference
- The handler function for the 'pause_dag' MCP tool. It takes a dag_id parameter, validates it, sends a PATCH request to the Airflow API to pause the DAG, and returns the dag_id and paused status. The @mcp.tool() decorator registers it as an MCP tool.@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") }