Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

delete_dag

Use this tool to remove a specific DAG (Directed Acyclic Graph) from Apache Airflow by specifying the DAG ID. Streamlines DAG cleanup and management within the MCP Server for Apache Airflow ecosystem.

Instructions

Delete a DAG

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes

Implementation Reference

  • The primary handler function for the "delete_dag" tool. It accepts a `dag_id` parameter, invokes the Airflow `dag_api.delete_dag` method, and returns the API response as MCP TextContent.
    async def delete_dag(dag_id: str) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = dag_api.delete_dag(dag_id=dag_id) return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The specific registration entry for "delete_dag" in the module's `get_all_functions()` list, including the function reference, tool name, description, and read-only flag (False). This is collected for top-level registration.
    (delete_dag, "delete_dag", "Delete a DAG", False),
  • src/main.py:8-8 (registration)
    Top-level import of the `get_all_functions` from the dag module in the main MCP server file, enabling inclusion of "delete_dag" in the tool registry.
    from src.airflow.dag import get_all_functions as get_dag_functions
  • src/main.py:95-96 (registration)
    The generic registration loop in main.py that adds all module functions, including "delete_dag", as MCP tools using `Tool.from_function`.
    for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))
  • Initialization of the `dag_api` client instance used by the "delete_dag" handler to interact with Airflow's DAG API.
    dag_api = DAGApi(api_client)

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