Skip to main content
Glama

get_dag

Retrieve detailed information for a specific DAG in Apache Airflow to inspect workflows, monitor tasks, and analyze pipeline configurations.

Instructions

[Tool Role]: Retrieves detailed information for a specific DAG.

Args: dag_id: The DAG ID to get details for

Returns: Comprehensive DAG details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_dag' MCP tool. Decorated with @mcp.tool() for automatic registration. Delegates core logic to the helper function get_dag_detailed_info.
    @mcp.tool()
    async def get_dag(dag_id: str) -> Dict[str, Any]:
        """
        [Tool Role]: Retrieves detailed information for a specific DAG.
    
        Args:
            dag_id: The DAG ID to get details for
    
        Returns:
            Comprehensive DAG details
        """
        return await get_dag_detailed_info(dag_id)
  • Core helper function implementing the DAG details retrieval via Airflow REST API (/dags/{dag_id}), parses and formats the response into a structured dictionary.
    async def get_dag_detailed_info(dag_id: str) -> Dict[str, Any]:
        """
        Internal helper function to get detailed DAG information.
        This function contains the actual implementation logic that can be reused.
        """
        if not dag_id:
            raise ValueError("dag_id must not be empty")
        resp = await airflow_request("GET", f"/dags/{dag_id}")
        resp.raise_for_status()
        dag = resp.json()
        return {
            "dag_id": dag.get("dag_id"),
            "dag_display_name": dag.get("dag_display_name"),
            "description": dag.get("description"),
            "schedule_interval": dag.get("schedule_interval"),
            "start_date": dag.get("start_date"),
            "end_date": dag.get("end_date"),
            "is_active": dag.get("is_active"),
            "is_paused": dag.get("is_paused"),
            "owners": dag.get("owners"),
            "tags": [t.get("name") for t in dag.get("tags", [])],
            "catchup": dag.get("catchup"),
            "max_active_runs": dag.get("max_active_runs"),
            "max_active_tasks": dag.get("max_active_tasks"),
            "has_task_concurrency_limits": dag.get("has_task_concurrency_limits"),
            "has_import_errors": dag.get("has_import_errors"),
            "next_dagrun": dag.get("next_dagrun"),
            "next_dagrun_data_interval_start": dag.get("next_dagrun_data_interval_start"),
            "next_dagrun_data_interval_end": dag.get("next_dagrun_data_interval_end")
        }
  • Registration call for common tools (including get_dag) in the v1 tools module.
    common_tools.register_common_tools(mcp)
  • Registration call for common tools (including get_dag) in the v2 tools module.
    common_tools.register_common_tools(mcp)
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 'detailed information' and returns 'Comprehensive DAG details', which hints at read-only behavior but doesn't explicitly confirm it as non-destructive. It lacks critical details like authentication requirements, rate limits, error handling, or what 'comprehensive' entails (e.g., structure, fields). For a tool with no annotations, this leaves significant gaps in understanding its operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and concise, using a '[Tool Role]' header and separate sections for 'Args' and 'Returns'. It avoids redundancy and wastes no words, making it easy to parse. However, the '[Tool Role]' formatting is slightly non-standard and could be more integrated, but it doesn't detract significantly from clarity.

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

Completeness3/5

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

Given the tool's complexity (single-parameter retrieval), lack of annotations, and presence of an output schema (which handles return values), the description is minimally complete. It covers the basic purpose and parameter but misses usage guidelines, behavioral details, and deeper context. With an output schema, it doesn't need to explain return values, but overall it's adequate yet leaves room for improvement in guiding the agent effectively.

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 input schema has 0% description coverage, but the description adds minimal parameter semantics: it defines 'dag_id' as 'The DAG ID to get details for', clarifying its purpose. However, it doesn't provide format examples, constraints, or validation rules. With one parameter and low schema coverage, the description compensates slightly but not fully, meeting the baseline for adequate but incomplete 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 tool's purpose as 'Retrieves detailed information for a specific DAG' with a specific verb ('Retrieves') and resource ('DAG'), making it understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_dags' (which lists multiple DAGs) or 'get_dags_detailed_batch' (which retrieves details for multiple DAGs), leaving some ambiguity about when to use this single-DAG retrieval versus batch alternatives.

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 'list_dags' for listing DAGs or 'get_dags_detailed_batch' for batch retrieval, nor does it specify prerequisites or exclusions. The agent must infer usage from the tool name and description alone, which is insufficient for optimal selection.

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/call518/MCP-Airflow-API'

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