Skip to main content
Glama
nikhil-ganage

MCP Server Airflow Token

get_dag_run

Retrieve a specific DAG run's details by providing the DAG ID and DAG run ID from Apache Airflow deployments.

Instructions

Get a DAG run by DAG ID and DAG run ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes

Implementation Reference

  • The main execution handler for the 'get_dag_run' tool. It calls the Airflow API to fetch the DAG run by dag_id and dag_run_id, adds a UI URL using get_dag_run_url helper, converts to dict, and returns as MCP TextContent.
    async def get_dag_run(
        dag_id: str, dag_run_id: str
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        response = dag_run_api.get_dag_run(dag_id=dag_id, dag_run_id=dag_run_id)
    
        # Convert response to dictionary for easier manipulation
        response_dict = response.to_dict()
    
        # Add UI link to DAG run
        response_dict["ui_url"] = get_dag_run_url(dag_id, dag_run_id)
    
        return [types.TextContent(type="text", text=str(response_dict))]
  • The get_all_functions() defines and returns the tuple for 'get_dag_run' tool (line 23) which is imported into src/main.py and used to register the tool via app.add_tool().
    def get_all_functions() -> list[tuple[Callable, str, str, bool]]:
        """Return list of (function, name, description, is_read_only) tuples for registration."""
        return [
            (post_dag_run, "post_dag_run", "Trigger a DAG by ID", False),
            (get_dag_runs, "get_dag_runs", "Get DAG runs by ID", True),
            (get_dag_runs_batch, "get_dag_runs_batch", "List DAG runs (batch)", True),
            (get_dag_run, "get_dag_run", "Get a DAG run by DAG ID and DAG run ID", True),
            (update_dag_run_state, "update_dag_run_state", "Update a DAG run state by DAG ID and DAG run ID", False),
            (delete_dag_run, "delete_dag_run", "Delete a DAG run by DAG ID and DAG run ID", False),
            (clear_dag_run, "clear_dag_run", "Clear a DAG run", False),
            (set_dag_run_note, "set_dag_run_note", "Update the DagRun note", False),
            (get_upstream_dataset_events, "get_upstream_dataset_events", "Get dataset events for a DAG run", True),
        ]
  • Helper function to generate the UI URL for a DAG run, used in the get_dag_run handler and other functions.
    def get_dag_run_url(dag_id: str, dag_run_id: str) -> str:
        return f"{AIRFLOW_HOST}/dags/{dag_id}/grid?dag_run_id={dag_run_id}"
  • src/main.py:90-92 (registration)
    The generic registration loop in main.py where tools from get_dagrun_functions() (including get_dag_run) are added to the MCP app via app.add_tool.
    for func, name, description, *_ in functions:
        app.add_tool(func, name=name, description=description)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't clarify aspects like error handling (e.g., what happens if IDs are invalid), authentication requirements, rate limits, or the format of the returned DAG run. This leaves significant gaps for an agent to understand how the tool behaves in practice.

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, direct sentence with zero wasted words. It front-loads the core action and parameters efficiently, making it easy to parse. Every part of the sentence contributes essential information without redundancy.

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

Completeness2/5

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

Given the complexity (a read operation with 2 required parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral traits, parameter details, or return values, leaving the agent with inadequate context to use the tool effectively beyond basic invocation. More information is needed to compensate for the missing structured data.

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

Parameters2/5

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

Schema description coverage is 0%, meaning parameters are undocumented in the schema. The description mentions 'DAG ID and DAG run ID' but adds minimal semantic value—it doesn't explain what these IDs represent, their format (e.g., strings, numeric), or where to obtain them. For a tool with 2 required parameters, this is insufficient to compensate for the lack of schema documentation.

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 action ('Get') and resource ('a DAG run') with specific identifiers ('by DAG ID and DAG run ID'), making the purpose unambiguous. It doesn't explicitly differentiate from sibling tools like 'get_dag_runs' (plural) or 'get_dag_details', but the specificity of requiring both IDs implies it retrieves a single run rather than a list or summary.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_dag_runs' for listing multiple runs or 'get_dag_details' for broader DAG information, nor does it specify prerequisites such as needing existing DAG and run IDs. Usage is implied only by the parameter names.

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/nikhil-ganage/mcp-server-airflow-token'

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