Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

delete_dag_run

Remove a specific DAG run from Apache Airflow using DAG ID and DAG run ID to manage workflow executions.

Instructions

Delete a DAG run by DAG ID and DAG run ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes

Implementation Reference

  • The main handler function that implements the logic for the 'delete_dag_run' tool by calling the Airflow DAGRunApi to delete the specified DAG run.
    async def delete_dag_run(
        dag_id: str, dag_run_id: str
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        response = dag_run_api.delete_dag_run(dag_id=dag_id, dag_run_id=dag_run_id)
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The registration function that includes the 'delete_dag_run' tool in the list of DAG run tools, which is imported and used in src/main.py to register tools with the MCP server.
    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),
        ]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a deletion operation, implying it's destructive, but doesn't specify whether this is permanent, reversible, requires specific permissions, or has side effects (e.g., on related tasks or data). For a destructive tool with zero annotation coverage, this is a significant gap in safety and operational context.

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 no wasted words. It's front-loaded with the core action and directly states the required identifiers, making it easy to parse quickly.

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?

For a destructive tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks critical information about behavioral traits (e.g., permanence, permissions), parameter details, and usage context compared to siblings like 'clear_dag_run'. This leaves the agent under-informed 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?

The description mentions parameters ('by DAG ID and DAG run ID'), which aligns with the two required parameters in the schema. However, schema description coverage is 0%, so the schema provides no details about these parameters. The description adds basic semantic context (what the parameters identify) but doesn't explain format, constraints, or examples, leaving significant gaps.

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 ('Delete') and resource ('a DAG run'), specifying it's identified by DAG ID and DAG run ID. It distinguishes from sibling tools like 'delete_dag' (which deletes the DAG itself) and 'clear_dag_run' (which clears but may not delete). However, it doesn't explicitly differentiate from 'clear_dag_run' in terms of permanent vs temporary removal.

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 like 'clear_dag_run' or 'delete_dag'. The description only states what it does, not when it's appropriate, what prerequisites exist, or what the consequences are compared to similar tools.

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/yangkyeongmo/mcp-server-apache-airflow'

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