get_environment
Retrieve configuration, status, endpoints, and metadata for a specific Amazon MWAA environment by providing its name.
Instructions
Get detailed information about a specific MWAA environment.
Args: name: The name of the MWAA environment
Returns: Dictionary containing environment details including configuration, status, endpoints, and other metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- awslabs/mwaa_mcp_server/server.py:43-56 (handler)Registration and handler definition for the 'get_environment' tool in the MCP server. It delegates the call to the MWAATools class.
@mcp.tool(name="get_environment") async def get_environment( name: str, ) -> Dict[str, Any]: """Get detailed information about a specific MWAA environment. Args: name: The name of the MWAA environment Returns: Dictionary containing environment details including configuration, status, endpoints, and other metadata """ return await tools.get_environment(name) - awslabs/mwaa_mcp_server/tools.py:116-131 (handler)The actual logic implementation for 'get_environment', using the boto3 mwaa_client to fetch environment details.
async def get_environment(self, name: str) -> Dict[str, Any]: """Get environment details.""" try: response = self.mwaa_client.get_environment(Name=name) env = response.get("Environment", {}) if "CreatedAt" in env: env["CreatedAt"] = env["CreatedAt"].isoformat() if "LastUpdate" in env and "CreatedAt" in env["LastUpdate"]: env["LastUpdate"]["CreatedAt"] = env["LastUpdate"]["CreatedAt"].isoformat() return {"Environment": env} except (ClientError, BotoCoreError) as e: logger.error("Error getting environment %s: %s", name, e) return {"error": str(e)}