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"
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. It states 'Get a DAG by ID', implying a read-only operation, but does not disclose behavioral traits like authentication needs, rate limits, error handling, or what data is returned (e.g., metadata, tasks, status). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 extremely concise with a single sentence, 'Get a DAG by ID', which is front-loaded and wastes no words. It efficiently conveys the core action, though this brevity contributes to gaps in other dimensions.

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 tool's complexity (simple retrieval but with many sibling alternatives), no annotations, no output schema, and low parameter coverage, the description is incomplete. It does not provide enough context for an AI agent to understand when to use it, what it returns, or how it behaves, making it inadequate for effective tool selection.

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?

The input schema has 1 parameter with 0% description coverage, and the description does not add any meaning beyond the schema. It mentions 'by ID' but does not explain what 'dag_id' represents, its format, or constraints. With low schema coverage, the description fails to compensate, leaving the parameter poorly documented.

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

Purpose3/5

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

The description 'Get a DAG by ID' clearly states the verb ('Get') and resource ('a DAG'), but it's vague about what 'Get' entails—whether it retrieves metadata, configuration, or status. It distinguishes from siblings like 'delete_dag' or 'patch_dag' by implying retrieval, but lacks specificity compared to tools like 'get_dag_details' or 'get_dag_source', which might offer more detailed information.

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. With siblings such as 'get_dag_details', 'get_dag_source', and 'fetch_dags', the description does not indicate if this is for basic retrieval, detailed info, or batch operations. There's no mention of prerequisites or context for usage.

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