Skip to main content
Glama

list_security_groups

Retrieve AWS security group configurations to manage network access controls and review firewall rules for EC2 instances and VPC resources.

Instructions

Lists all security groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vpc_idNoOptional: Filter by VPC ID.

Implementation Reference

  • Handler function that executes the list_security_groups tool by calling DescribeSecurityGroupsCommand on EC2 client, optionally filtering by VPC ID, and returns formatted security group list.
    if (name === "list_security_groups") { const vpcId = (args as any)?.vpc_id; const filter = vpcId ? [{ Name: "vpc-id", Values: [vpcId] }] : undefined; const command = new DescribeSecurityGroupsCommand({ Filters: filter }); const response = await ec2Client.send(command); const sgs = response.SecurityGroups?.map(s => ({ GroupId: s.GroupId, GroupName: s.GroupName, Description: s.Description, VpcId: s.VpcId })) || []; return { content: [{ type: "text", text: JSON.stringify(sgs, null, 2) }] };
  • src/index.ts:340-348 (registration)
    Registration of the list_security_groups tool in the ListToolsRequestHandler, including its description and input schema.
    { name: "list_security_groups", description: "Lists all security groups.", inputSchema: { type: "object", properties: { vpc_id: { type: "string", description: "Optional: Filter by VPC ID." } } }
  • Input schema definition allowing optional vpc_id parameter.
    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