Skip to main content
Glama
astronomer

astro-airflow-mcp

Official
by astronomer

trigger_dag_and_wait

Trigger an Apache Airflow DAG run and wait for its completion, returning the final state and details of any failed tasks. Blocks until the run ends or times out (default 60 minutes).

Instructions

Trigger a DAG run and wait for it to complete before returning.

Use this tool when the user asks to:

  • "Run DAG X and wait for it to finish" or "Execute DAG Y and tell me when it's done"

  • "Trigger DAG Z and wait for completion" or "Run this pipeline synchronously"

  • "Start DAG X and let me know the result" or "Execute and monitor DAG Y"

  • "Run DAG X and show me if it succeeds or fails"

This is a BLOCKING operation that will:

  1. Trigger the specified DAG

  2. Poll for status automatically (interval scales with timeout)

  3. Return once the DAG run reaches a terminal state (success, failed, upstream_failed)

  4. Include details about any failed tasks if the run was not successful

IMPORTANT: This tool blocks until the DAG completes or times out. For long-running DAGs, consider using trigger_dag instead and checking status separately with get_dag_run.

Default timeout is 60 minutes. Adjust the timeout parameter for longer DAGs.

Returns information about the completed DAG run including:

  • dag_id: Which DAG was run

  • dag_run_id: Unique identifier for this execution

  • state: Final state (success, failed, upstream_failed)

  • start_date: When execution started

  • end_date: When execution completed

  • elapsed_seconds: How long we waited

  • timed_out: Whether we hit the timeout before completion

  • failed_tasks: List of failed task details (only if state != success)

Args: dag_id: The ID of the DAG to trigger (e.g., "example_dag") conf: Optional configuration dictionary to pass to the DAG run. This will be available in the DAG via context['dag_run'].conf timeout: Maximum time to wait in seconds (default: 3600.0 / 60 minutes)

Returns: JSON with final DAG run status and any failed task details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
confNo
timeoutNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully carries the burden. It explicitly states 'This is a BLOCKING operation', describes internal steps (trigger, poll, return), default timeout, and details on failed tasks. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with bullet points and clear sections. It is front-loaded with purpose. However, it is slightly verbose; some sentences could be combined. Still highly effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (blocking, polling, timeout, failure handling), the description is thorough. It explains the process, return fields, and even though an output schema exists, the description adds context. No gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description adds rich meaning to all three parameters: `dag_id` with example, `conf` behavior description, and `timeout` default. This significantly aids an AI agent in understanding parameter usage beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action: 'Trigger a DAG run and wait for it to complete before returning.' It provides specific verb and resource, distinguishes from sibling `trigger_dag` by explicitly noting the blocking behavior, and includes example queries that match common user requests.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly lists example queries for when to use this tool and advises against it for long-running DAGs by suggesting `trigger_dag` and `get_dag_run` as alternatives. This clear when-to-use and when-not-to-use guidance is exemplary.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/astronomer/astro-airflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server