Skip to main content
Glama

list_nat_gateways

Retrieve NAT Gateways with their state and public IP addresses to monitor network connectivity and manage AWS infrastructure. Optionally filter by VPC ID.

Instructions

Lists NAT Gateways with their state and public IP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vpc_idNoOptional: Filter by VPC ID.

Implementation Reference

  • Handler implementation for the 'list_nat_gateways' tool. It optionally filters by VPC ID, calls DescribeNatGatewaysCommand via ec2Client, maps the response to a simplified format including ID, VPC, subnet, state, public IP, and name tag, and returns as JSON.
    if (name === "list_nat_gateways") {
        const vpcId = (args as any)?.vpc_id;
        const input: any = {};
        if (vpcId) input.Filter = [{ Name: "vpc-id", Values: [vpcId] }];
    
        const command = new DescribeNatGatewaysCommand(input);
        const response = await ec2Client.send(command);
    
        const nats = response.NatGateways?.map(nat => ({
            NatGatewayId: nat.NatGatewayId,
            VpcId: nat.VpcId,
            SubnetId: nat.SubnetId,
            State: nat.State,
            PublicIp: nat.NatGatewayAddresses?.[0]?.PublicIp,
            Name: nat.Tags?.find(t => t.Key === "Name")?.Value
        })) || [];
    
        return { content: [{ type: "text", text: JSON.stringify(nats, null, 2) }] };
    }
  • src/index.ts:331-339 (registration)
    Tool registration in the ListTools response, including name, description, and input schema (optional vpc_id).
        name: "list_nat_gateways",
        description: "Lists NAT Gateways with their state and public IP.",
        inputSchema: {
            type: "object",
            properties: {
                vpc_id: { type: "string", description: "Optional: Filter by VPC ID." }
            }
        }
    },
  • Input schema definition for the 'list_nat_gateways' tool as part of its registration.
        name: "list_nat_gateways",
        description: "Lists NAT Gateways with their state and public IP.",
        inputSchema: {
            type: "object",
            properties: {
                vpc_id: { type: "string", description: "Optional: Filter by VPC ID." }
            }
        }
    },
  • Import of DescribeNatGatewaysCommand and EC2Client used by the handler.
    import { EC2Client, DescribeInstancesCommand, DescribeSecurityGroupsCommand, DescribeAddressesCommand, DescribeVolumesCommand, DescribeVpcsCommand, DescribeSubnetsCommand, DescribeRouteTablesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand } from "@aws-sdk/client-ec2";
  • Initialization of the shared EC2Client instance used by the list_nat_gateways handler.
    const ec2Client = new EC2Client({});
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'Lists NAT Gateways' but doesn't cover critical aspects like whether this is a read-only operation, if it requires specific permissions, pagination behavior, rate limits, or what happens on errors. This leaves significant gaps for an agent to understand how to use it safely and effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns a list of resources. It doesn't explain the return format, error handling, or behavioral traits, which are crucial for an agent to use it correctly in a cloud environment with many sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'vpc_id' documented as 'Optional: Filter by VPC ID.' The description doesn't add any meaning beyond this, such as format examples or usage context, so it meets the baseline score of 3 where the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Lists') and resource ('NAT Gateways') with specific attributes ('their state and public IP'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_vpcs' or 'list_subnets' beyond the resource type, which is why it doesn't reach a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as other listing tools for AWS resources or filtering options. It mentions no prerequisites, exclusions, or context for selection among the many sibling tools available.

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/bhaveshopss/MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server