Skip to main content
Glama

list_dag_runs

Retrieve and filter DAG run history from Amazon MWAA environments to monitor workflow execution status, analyze performance, and troubleshoot issues.

Instructions

List DAG runs for a specific DAG.

Args: environment_name: Name of the MWAA environment dag_id: The DAG ID limit: Number of items to return state: Filter by state (queued, running, success, failed) execution_date_gte: Filter by execution date >= (ISO format) execution_date_lte: Filter by execution date <= (ISO format)

Returns: Dictionary containing list of DAG runs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environment_nameYes
dag_idYes
limitNo
stateNo
execution_date_gteNo
execution_date_lteNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation logic for list_dag_runs in the tools class, which invokes the Airflow API.
    async def list_dag_runs(
        self,
        environment_name: str,
        dag_id: str,
        limit: Optional[int] = 100,
        state: Optional[List[str]] = None,
        execution_date_gte: Optional[str] = None,
        execution_date_lte: Optional[str] = None,
    ) -> Dict[str, Any]:
        """List DAG runs via Airflow API."""
        params: Dict[str, Any] = {"limit": limit}
    
        if state:
            params["state"] = state
        if execution_date_gte:
            params["execution_date_gte"] = execution_date_gte
        if execution_date_lte:
            params["execution_date_lte"] = execution_date_lte
    
        return self._invoke_airflow_api(
            environment_name, "GET", f"/dags/{dag_id}/dagRuns", params=params
        )
  • The MCP tool registration and wrapper function for list_dag_runs.
    @mcp.tool(name="list_dag_runs")
    async def list_dag_runs(
        environment_name: str,
        dag_id: str,
        limit: Optional[int] = 100,
        state: Optional[List[str]] = None,
        execution_date_gte: Optional[str] = None,
        execution_date_lte: Optional[str] = None,
    ) -> Dict[str, Any]:
        """List DAG runs for a specific DAG.
    
        Args:
            environment_name: Name of the MWAA environment
            dag_id: The DAG ID
            limit: Number of items to return
            state: Filter by state (queued, running, success, failed)
            execution_date_gte: Filter by execution date >= (ISO format)
            execution_date_lte: Filter by execution date <= (ISO format)
    
        Returns:
            Dictionary containing list of DAG runs
        """
        limit_int = int(limit) if limit is not None else 100
    
        return await tools.list_dag_runs(
            environment_name,
            dag_id,
Behavior3/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 partially succeeds by documenting filtering capabilities (state values, date range boundaries, limit), but fails to mention pagination behavior, sorting order, required IAM permissions, or error conditions (e.g., invalid DAG ID).

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 Google-style docstring format (Args/Returns) is well-structured and front-loaded with the primary purpose. The Returns section is appropriately brief given the existence of an output schema, though the description overall is slightly verbose with redundant 'Filter by' prefixes for date parameters.

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

Completeness4/5

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

Given the output schema exists, the description adequately covers all input parameters with their formats and constraints. It sufficiently describes the operation for a filtered list query, though it could improve by mentioning pagination continuation tokens or default sorting behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Excellent compensation for 0% schema description coverage. The Args section documents all 6 parameters with clear semantics, including enumerating valid state values (queued, running, success, failed) and specifying the ISO format requirement for date parameters—critical details absent from the schema.

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 'List[s] DAG runs for a specific DAG' using a specific verb and resource. However, it does not explicitly differentiate from sibling tool `get_dag_run` (which retrieves a single run), leaving mild ambiguity about when to use the list operation versus the singular get operation.

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 like `get_dag_run` or `trigger_dag_run`, nor does it mention prerequisites such as requiring an existing DAG or specific permissions. It simply states what the tool does, not when to choose it.

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/paschmaria/mwaa-mcp-server'

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