Skip to main content
Glama
nikhil-ganage

MCP Server Airflow Token

get_dag

Retrieve a specific Directed Acyclic Graph (DAG) from Apache Airflow using its unique identifier to access workflow definitions and configurations.

Instructions

Get a DAG by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes

Implementation Reference

  • The core handler function implementing the 'get_dag' tool logic: fetches DAG details from Airflow API, adds UI URL, and returns as text content.
    async def get_dag(dag_id: str) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = dag_api.get_dag(dag_id=dag_id) # Convert response to dictionary for easier manipulation response_dict = response.to_dict() # Add UI link to DAG response_dict["ui_url"] = get_dag_url(dag_id) return [types.TextContent(type="text", text=str(response_dict))]
  • Specific registration entry for the 'get_dag' tool within the get_all_functions() list for DAG-related tools.
    (get_dag, "get_dag", "Get a DAG by ID", True),
  • src/main.py:90-91 (registration)
    The generic app.add_tool() call in main.py that registers the 'get_dag' handler (among others) to the MCP server.
    for func, name, description, *_ in functions: app.add_tool(func, name=name, description=description)
  • Helper utility to generate UI URL for DAGs, invoked by the get_dag handler.
    def get_dag_url(dag_id: str) -> str: return f"{AIRFLOW_HOST}/dags/{dag_id}/grid"

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