Skip to main content
Glama

list_dags

Retrieve and filter DAGs in Amazon MWAA environments to monitor workflows, using parameters like tags, ID patterns, and activity status.

Instructions

List all DAGs in an MWAA environment.

Args: environment_name: Name of the MWAA environment limit: Number of items to return (max 100) offset: Number of items to skip tags: Filter by DAG tags dag_id_pattern: Filter by DAG ID pattern (supports % wildcards) only_active: Only return active DAGs

Returns: Dictionary containing list of DAGs with their details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environment_nameYes
limitNo
offsetNo
tagsNo
dag_id_patternNo
only_activeNo

Implementation Reference

  • The actual implementation of the list_dags tool that interacts with the Airflow API.
    async def list_dags(
        self,
        environment_name: str,
        limit: Optional[int] = 100,
        offset: Optional[int] = 0,
        tags: Optional[List[str]] = None,
        dag_id_pattern: Optional[str] = None,
        only_active: Optional[bool] = True,
    ) -> Dict[str, Any]:
        """List DAGs via Airflow API."""
        params: Dict[str, Any] = {
            "limit": limit,
            "offset": offset,
            "only_active": only_active,
        }
    
        if tags:
            params["tags"] = ",".join(tags)
        if dag_id_pattern:
            params["dag_id_pattern"] = dag_id_pattern
    
        return self._invoke_airflow_api(environment_name, "GET", "/dags", params=params)
  • MCP tool registration for 'list_dags', which wraps the tool implementation and handles parameter type conversion.
    @mcp.tool(name="list_dags")
    async def list_dags(
        environment_name: str,
        limit: Optional[int] = 100,
        offset: Optional[int] = 0,
        tags: Optional[List[str]] = None,
        dag_id_pattern: Optional[str] = None,
        only_active: Optional[bool] = True,
    ) -> Dict[str, Any]:
        """List all DAGs in an MWAA environment.
    
        Args:
            environment_name: Name of the MWAA environment
            limit: Number of items to return (max 100)
            offset: Number of items to skip
            tags: Filter by DAG tags
            dag_id_pattern: Filter by DAG ID pattern (supports % wildcards)
            only_active: Only return active DAGs
    
        Returns:
            Dictionary containing list of DAGs with their details
        """
        limit_int = int(limit) if limit is not None else 100
        offset_int = int(offset) if offset is not None else 0
    
        return await tools.list_dags(
            environment_name, limit_int, offset_int, tags, dag_id_pattern, only_active
        )

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