list_record_sets
Retrieve DNS records from a specified AWS hosted zone to manage domain configurations and verify record details.
Instructions
Lists DNS records for a given hosted zone.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hosted_zone_id | Yes | The ID of the Hosted Zone. |
Implementation Reference
- src/index.ts:694-706 (registration)Registration of the 'list_record_sets' tool, including its description and input schema requiring 'hosted_zone_id'.name: "list_record_sets", description: "Lists DNS records for a given hosted zone.", inputSchema: { type: "object", properties: { hosted_zone_id: { type: "string", description: "The ID of the Hosted Zone." } }, required: ["hosted_zone_id"] } },
- src/index.ts:2141-2155 (handler)Handler function for 'list_record_sets' tool. Uses Route53Client's ListResourceRecordSetsCommand to fetch DNS records for the given hosted zone ID and returns them as JSON.if (name === "list_record_sets") { const zoneId = (args as any)?.hosted_zone_id; const command = new ListResourceRecordSetsCommand({ HostedZoneId: zoneId }); const response = await route53Client.send(command); const records = response.ResourceRecordSets?.map(r => ({ Name: r.Name, Type: r.Type, TTL: r.TTL, ResourceRecords: r.ResourceRecords, AliasTarget: r.AliasTarget })) || []; return { content: [{ type: "text", text: JSON.stringify(records, null, 2) }] }; }
- src/index.ts:36-36 (helper)Import of Route53Client and ListResourceRecordSetsCommand used by the tool.import { Route53Client, ListHostedZonesCommand, ListResourceRecordSetsCommand } from "@aws-sdk/client-route-53";
- src/index.ts:70-70 (helper)Initialization of the Route53Client instance used by the tool.const route53Client = new Route53Client({});