list_unassociated_eips
Identify Elastic IP addresses not currently linked to any AWS EC2 instance to help optimize resource usage and reduce costs.
Instructions
Lists Elastic IPs that are not associated with any instance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1679-1692 (handler)Handler function that lists unassociated Elastic IPs by calling DescribeAddressesCommand and filtering Addresses without AssociationId.if (name === "list_unassociated_eips") { const command = new DescribeAddressesCommand({}); const response = await ec2Client.send(command); // Filter where AssociationId is missing const unusedEips = response.Addresses?.filter(a => !a.AssociationId).map(a => ({ PublicIp: a.PublicIp, AllocationId: a.AllocationId, Domain: a.Domain })) || []; return { content: [{ type: "text", text: JSON.stringify(unusedEips, null, 2) }] }; }
- src/index.ts:439-446 (registration)Tool registration in the ListTools response, including name, description, and empty input schema.{ name: "list_unassociated_eips", description: "Lists Elastic IPs that are not associated with any instance.", inputSchema: { type: "object", properties: {} } },
- src/index.ts:442-446 (schema)Input schema definition for the tool (empty object).inputSchema: { type: "object", properties: {} } },