list_internet_gateways
List and view attachments for Internet Gateways in AWS to manage network connectivity and routing configurations.
Instructions
Lists Internet Gateways and their attachments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1405-1416 (handler)Handler function that executes the list_internet_gateways tool by calling DescribeInternetGatewaysCommand on EC2 client and formatting the response.if (name === "list_internet_gateways") { const command = new DescribeInternetGatewaysCommand({}); const response = await ec2Client.send(command); const igws = response.InternetGateways?.map(igw => ({ InternetGatewayId: igw.InternetGatewayId, Attachments: igw.Attachments, Name: igw.Tags?.find(t => t.Key === "Name")?.Value })) || []; return { content: [{ type: "text", text: JSON.stringify(igws, null, 2) }] }; }
- src/index.ts:322-329 (registration)Registration of the list_internet_gateways tool in the ListTools response, including description and empty input schema.{ name: "list_internet_gateways", description: "Lists Internet Gateways and their attachments.", inputSchema: { type: "object", properties: {} } },
- src/index.ts:325-328 (schema)Input schema for list_internet_gateways tool (empty object).inputSchema: { type: "object", properties: {} }
- src/index.ts:19-19 (helper)Import of DescribeInternetGatewaysCommand used by the tool.import { EC2Client, DescribeInstancesCommand, DescribeSecurityGroupsCommand, DescribeAddressesCommand, DescribeVolumesCommand, DescribeVpcsCommand, DescribeSubnetsCommand, DescribeRouteTablesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand } from "@aws-sdk/client-ec2";
- src/index.ts:53-53 (helper)EC2 client instance used by the tool handler.const ec2Client = new EC2Client({});