Skip to main content
Glama

trigger_dag

Start a new DAG run in Apache Airflow by specifying the DAG ID, enabling workflow execution through the MCP-Airflow-API server.

Instructions

[Tool Role]: Triggers a new DAG run for a specified Airflow DAG.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function for the 'trigger_dag' tool. Decorated with @mcp.tool() for automatic registration. Triggers a new DAG run by making a POST request to the Airflow API.
    @mcp.tool()
    async def trigger_dag(dag_id: str) -> Dict[str, Any]:
        """[Tool Role]: Triggers a new DAG run for a specified Airflow DAG."""
        if not dag_id:
            raise ValueError("dag_id must not be empty")
        resp = await airflow_request("POST", f"/dags/{dag_id}/dagRuns", json={"conf": {}})
        resp.raise_for_status()
        run = resp.json()
        return {
            "dag_id": dag_id,
            "run_id": run.get("run_id"),
            "state": run.get("state"),
            "execution_date": run.get("execution_date"),
            "start_date": run.get("start_date"),
            "end_date": run.get("end_date")
        }
  • Registration of common tools (including trigger_dag) for Airflow API v1 by calling register_common_tools after setting v1-specific airflow_request.
    common_tools.airflow_request = airflow_request_v1
    
    # Register all 56 common tools (includes management tools)
    common_tools.register_common_tools(mcp)
  • Registration of common tools (including trigger_dag) for Airflow API v2 by calling register_common_tools after setting v2-specific airflow_request.
    common_tools.airflow_request = airflow_request_v2
    
    # Register all 43 common tools
    common_tools.register_common_tools(mcp)
  • Top-level registration call for v1 tools in mcp_main.py (create_mcp_server function).
    from mcp_airflow_api.tools import v1_tools
    v1_tools.register_tools(mcp_instance)
  • Top-level registration call for v2 tools in mcp_main.py (create_mcp_server function).
    from mcp_airflow_api.tools import v2_tools
    v2_tools.register_tools(mcp_instance)
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose whether this requires specific permissions, what happens if the DAG is paused, rate limits, or the nature of the trigger (e.g., manual vs. scheduled), leaving significant gaps for a mutation tool.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste, front-loading the core action. Every word contributes directly to stating the tool's role, making it appropriately sized and well-structured.

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

Completeness3/5

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

Given the tool's complexity (a mutation with no annotations) and the presence of an output schema, the description is minimally adequate but incomplete. It covers the basic action but lacks behavioral context, usage guidelines, and parameter details needed for safe and effective use.

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

Parameters3/5

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

Schema description coverage is 0%, but the description adds minimal value by implying 'dag_id' specifies the Airflow DAG. It doesn't explain parameter format, constraints, or examples beyond what the schema's title suggests, so it partially compensates but inadequately for a tool with undocumented parameters.

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

Purpose4/5

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

The description clearly states the verb ('Triggers') and resource ('a new DAG run for a specified Airflow DAG'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'pause_dag' or 'unpause_dag' that also affect DAG execution, missing full sibling distinction.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., DAG must be unpaused), exclusions, or compare to similar tools like 'pause_dag' or 'unpause_dag', leaving usage context unclear.

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/call518/MCP-Airflow-API'

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