networkinsights_list_scopes
Retrieve a JSON list of all Network Access Scopes in a specified AWS region. Use parameters like 'aws_region' to filter results.
Instructions
Describe all Network Access Scopes in the region.
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
Returns:
JSON list of NetworkInsightsAccessScope objects.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes |
Implementation Reference
- server.py:813-827 (handler)The main handler function for the 'networkinsights_list_scopes' tool. It uses the EC2 boto3 client to describe network insights access scopes in the specified AWS region and returns the result as a JSON string. The @mcp.tool() decorator registers this function as an MCP tool, automatically generating the schema from the function signature.@mcp.tool() async def networkinsights_list_scopes(aws_region: str) -> str: """ Describe all Network Access Scopes in the region. Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. Returns: JSON list of NetworkInsightsAccessScope objects. """ client = boto3.client('ec2', region_name=aws_region) resp = client.describe_network_insights_access_scopes() scopes = resp.get('NetworkInsightsAccessScopes', []) return json.dumps(scopes, indent=2, cls=DateTimeEncoder)
- server.py:813-813 (registration)The @mcp.tool() decorator on the networkinsights_list_scopes function registers it as an MCP tool named 'networkinsights_list_scopes'.@mcp.tool()