Skip to main content
Glama

list_environments

Retrieve all Amazon MWAA environments in your AWS account and region to manage Apache Airflow workflows and monitor operations.

Instructions

List all MWAA environments in the current AWS account and region.

Args: max_results: Maximum number of environments to return (1-25)

Returns: Dictionary containing list of environment names and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler method in `MWAATools` class that interacts with Boto3 to list MWAA environments and get their details.
    async def list_environments(self, max_results: Optional[int] = None) -> Dict[str, Any]:
        """List MWAA environments."""
        try:
            kwargs: Dict[str, Any] = {}
            if max_results:
                kwargs["MaxResults"] = min(max_results, 25)
    
            response = self.mwaa_client.list_environments(**kwargs)
    
            environments = []
            for env_name in response.get("Environments", []):
                try:
                    env_details = await self.get_environment(env_name)
                    environments.append(
                        {
                            "Name": env_name,
                            "Status": env_details.get("Environment", {}).get("Status"),
                            "Arn": env_details.get("Environment", {}).get("Arn"),
                            "CreatedAt": env_details.get("Environment", {}).get("CreatedAt"),
                        }
                    )
                except Exception as e:
                    logger.error("Error getting details for environment %s: %s", env_name, e)
                    environments.append(
                        {
                            "Name": env_name,
                            "Status": "ERROR",
                            "Error": str(e),
                        }
                    )
    
            return {
                "Environments": environments,
                "NextToken": response.get("NextToken"),
            }
    
        except (ClientError, BotoCoreError) as e:
            logger.error("Error listing environments: %s", e)
            return {"error": str(e)}
  • The registration of the 'list_environments' tool in the FastMCP server, which wraps the `MWAATools.list_environments` method.
    @mcp.tool(name="list_environments")
    async def list_environments(
        max_results: Optional[int] = None,
    ) -> Dict[str, Any]:
        """List all MWAA environments in the current AWS account and region.
    
        Args:
            max_results: Maximum number of environments to return (1-25)
    
        Returns:
            Dictionary containing list of environment names and metadata
        """
        max_results_int = int(max_results) if max_results is not None else None
        return await tools.list_environments(max_results_int)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Adds AWS-specific context ('current AWS account and region') and return type structure. However, omits pagination continuation behavior, API rate limits, credential requirements, or whether results are cached/live.

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?

Uses structured Args/Returns format effectively. First sentence clearly states purpose. Slightly redundant to include Returns section when output schema exists, but necessary given overall schema coverage gaps. No filler words.

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?

Appropriate for a single-parameter list operation. Covers resource scope, pagination limit constraints, and return structure. Missing only AWS-specific behavioral details (pagination tokens, throttling). Acceptable given output schema exists to document return values.

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?

Schema coverage is 0%, but description compensates fully by documenting max_results with validation range (1-25) and semantics ('Maximum number of environments to return'), providing critical constraints absent from the JSON schema.

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

Purpose5/5

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

States specific verb ('List') + resource ('MWAA environments') + scope ('current AWS account and region'). Clearly distinguishes from sibling 'get_environment' (single) and mutation tools like 'create_environment'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternatives mentioned. While naming convention implies enumeration vs. retrieval, lacks guidance like 'use this to discover environments before calling get_environment' or pagination behavior when results exceed max_results.

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