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
| Name | Required | Description | Default |
|---|---|---|---|
| environment_name | Yes | ||
| limit | No | ||
| offset | No | ||
| tags | No | ||
| dag_id_pattern | No | ||
| only_active | No |
Implementation Reference
- awslabs/mwaa_mcp_server/tools.py:252-273 (handler)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) - awslabs/mwaa_mcp_server/server.py:248-275 (registration)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 )