Skip to main content
Glama

list_route_tables

Retrieve AWS VPC route tables with their routes and associations to manage network traffic flow. Filter results by VPC ID for targeted analysis.

Instructions

Lists route tables with their routes and associations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vpc_idNoOptional: Filter by VPC ID.

Implementation Reference

  • Handler function for the 'list_route_tables' tool. Uses AWS EC2 DescribeRouteTablesCommand, optionally filtered by VPC ID, maps response to include routes, associations, and tags.
    if (name === "list_route_tables") { const vpcId = (args as any)?.vpc_id; const input: any = {}; if (vpcId) input.Filters = [{ Name: "vpc-id", Values: [vpcId] }]; const command = new DescribeRouteTablesCommand(input); const response = await ec2Client.send(command); const routeTables = response.RouteTables?.map(rt => ({ RouteTableId: rt.RouteTableId, VpcId: rt.VpcId, Routes: rt.Routes?.map(r => ({ DestinationCidrBlock: r.DestinationCidrBlock, GatewayId: r.GatewayId, NatGatewayId: r.NatGatewayId, State: r.State })), Associations: rt.Associations?.map(a => ({ RouteTableAssociationId: a.RouteTableAssociationId, SubnetId: a.SubnetId, Main: a.Main })), Name: rt.Tags?.find(t => t.Key === "Name")?.Value })) || []; return { content: [{ type: "text", text: JSON.stringify(routeTables, null, 2) }] }; }
  • src/index.ts:313-321 (registration)
    Registration of the 'list_route_tables' tool in the ListTools response, including name, description, and input schema definition.
    name: "list_route_tables", description: "Lists route tables with their routes and associations.", inputSchema: { type: "object", properties: { vpc_id: { type: "string", description: "Optional: Filter by VPC ID." } } } },

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

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