Skip to main content
Glama

list_target_groups

Retrieve all AWS Target Groups to manage application traffic routing and load balancing configurations.

Instructions

Lists all Target Groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
load_balancer_arnNoOptional: Filter by Load Balancer ARN.

Implementation Reference

  • Handler implementation for the 'list_target_groups' tool. Calls AWS ELBv2 DescribeTargetGroupsCommand, optionally filtered by LoadBalancerArn, and maps the response to a simplified JSON output.
    if (name === "list_target_groups") {
        const lbArn = (args as any)?.load_balancer_arn;
        const command = new DescribeTargetGroupsCommand(lbArn ? { LoadBalancerArn: lbArn } : {});
        const response = await elbv2Client.send(command);
        const tgs = response.TargetGroups?.map(tg => ({
            TargetGroupName: tg.TargetGroupName,
            Protocol: tg.Protocol,
            Port: tg.Port,
            TargetType: tg.TargetType,
            TargetGroupArn: tg.TargetGroupArn,
            LoadBalancerArns: tg.LoadBalancerArns
        })) || [];
        return { content: [{ type: "text", text: JSON.stringify(tgs, null, 2) }] };
    }
  • src/index.ts:565-577 (registration)
    Tool registration in the ListTools handler, defining the tool name, description, and input schema for 'list_target_groups'.
    {
        name: "list_target_groups",
        description: "Lists all Target Groups.",
        inputSchema: {
            type: "object",
            properties: {
                load_balancer_arn: {
                    type: "string",
                    description: "Optional: Filter by Load Balancer ARN."
                }
            }
        }
    },
  • Input schema definition for the 'list_target_groups' tool, specifying optional load_balancer_arn parameter.
    {
        name: "list_target_groups",
        description: "Lists all Target Groups.",
        inputSchema: {
            type: "object",
            properties: {
                load_balancer_arn: {
                    type: "string",
                    description: "Optional: Filter by Load Balancer ARN."
                }
            }
        }
    },

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