Skip to main content
Glama

aws_route53

Manage AWS Route53 DNS records and zones to configure domain routing, update resource mappings, and maintain DNS infrastructure through automated operations.

Instructions

Manage AWS Route53 DNS records and zones

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
regionYes
zoneIdNo
zoneNameNo
recordNameNo
recordTypeNo
recordTtlNo
recordValueNo
recordStateNo
commentNo

Implementation Reference

  • The handler function for the 'aws_route53' tool. It destructures input args, generates an Ansible playbook based on the specified action (list_zones, list_records, create_zone, create_record, delete_record, delete_zone), and executes it using executeAwsPlaybook.
    export async function route53Operations(args: Route53Options): Promise<string> {
      await verifyAwsCredentials();
    
      const { action, region, zoneId, zoneName, recordName, recordType, recordTtl, recordValue, recordState, comment } = args;
    
      let playbookContent = `---
    - name: AWS Route53 ${action} operation
      hosts: localhost
      connection: local
      gather_facts: no
      tasks:`;
      
      switch (action) {
        case 'list_zones':
          playbookContent += `
        - name: List Route53 hosted zones
          amazon.aws.route53_info:
            region: "${region}"
            query: hosted_zone
          register: route53_zones
        
        - name: Display hosted zones
          debug:
            var: route53_zones.HostedZones`;
          break;
          
        case 'list_records':
          playbookContent += `
        - name: List Route53 records
          amazon.aws.route53_info:
            region: "${region}"
            query: record_sets
            hosted_zone_id: "${zoneId}"
          register: route53_records
        
        - name: Display records
          debug:
            var: route53_records.ResourceRecordSets`;
          break;
          
        case 'create_zone':
          playbookContent += `
        - name: Create Route53 hosted zone
          amazon.aws.route53_zone:
            region: "${region}"
            zone: "${zoneName}"
            state: present
    ${formatYamlParams({ comment })}
          register: route53_result
        
        - name: Display zone details
          debug:
            var: route53_result`;
          break;
          
        case 'create_record':
          playbookContent += `
        - name: Create Route53 record
          amazon.aws.route53:
            region: "${region}"
            zone: "${zoneName}"
            record: "${recordName}"
            type: "${recordType}"
            ttl: ${recordTtl ?? 300}
            value: ${JSON.stringify(Array.isArray(recordValue) ? recordValue : [recordValue])}
            state: ${recordState ?? 'present'}
    ${formatYamlParams({ comment })}
          register: route53_result
        
        - name: Display record details
          debug:
            var: route53_result`;
          break;
          
        case 'delete_record':
          playbookContent += `
        - name: Delete Route53 record
          amazon.aws.route53:
            region: "${region}"
            zone: "${zoneName}"
            record: "${recordName}"
            type: "${recordType}"
            # Value might be needed for deletion depending on the record type/setup
            value: ${JSON.stringify(Array.isArray(recordValue) ? recordValue : [recordValue])} 
            state: absent
          register: route53_delete
        
        - name: Display deletion result
          debug:
            var: route53_delete`;
          break;
          
        case 'delete_zone':
          playbookContent += `
        - name: Delete Route53 hosted zone
          amazon.aws.route53_zone:
            region: "${region}"
            zone: "${zoneName}"
            state: absent
          register: route53_zone_delete
        
        - name: Display deletion result
          debug:
            var: route53_zone_delete`;
          break;
          
        default:
          throw new AnsibleError(`Unsupported Route53 action: ${action}`);
      }
      
      // Execute the generated playbook
      return executeAwsPlaybook(`route53-${action}`, playbookContent);
    }
  • Zod schema defining the input parameters for the aws_route53 tool, including action enum and optional fields like region, zone details, record details.
    export const Route53Schema = z.object({
      action: Route53ActionEnum,
      region: z.string().min(1, 'AWS region is required'),
      zoneId: z.string().optional(),
      zoneName: z.string().optional(),
      recordName: z.string().optional(),
      recordType: z.string().optional(),
      recordTtl: z.number().optional(),
      recordValue: z.union([z.string(), z.array(z.string())]).optional(),
      recordState: z.string().optional(),
      comment: z.string().optional() // Added based on usage in aws.ts
    });
    
    export type Route53Options = z.infer<typeof Route53Schema>;
  • Registration of the 'aws_route53' tool in the toolDefinitions map, linking description, schema, and handler.
    aws_route53: {
      description: 'Manage AWS Route53 DNS records and zones',
      schema: aws.Route53Schema,
      handler: aws.route53Operations,
    },
  • Zod enum defining possible actions for the Route53 tool.
    export const Route53ActionEnum = z.enum(['list_zones', 'list_records', 'create_zone', 'create_record', 'delete_record', 'delete_zone']);
    export type Route53Action = z.infer<typeof Route53ActionEnum>;
  • Helper function used by all AWS handlers (including route53Operations) to execute dynamically generated Ansible playbooks for AWS operations.
    async function executeAwsPlaybook(
      operationName: string, 
      playbookContent: string, 
      extraParams: string = '',
      tempFiles: { filename: string, content: string }[] = [] // For additional files like templates, policies
    ): Promise<string> {
      let tempDir: string | undefined;
      try {
        // Create a unique temporary directory
        tempDir = await createTempDirectory(`ansible-aws-${operationName}`);
        
        // Write the main playbook file
        const playbookPath = await writeTempFile(tempDir, 'playbook.yml', playbookContent);
        
        // Write any additional temporary files
        for (const file of tempFiles) {
          await writeTempFile(tempDir, file.filename, file.content);
        }
    
        // Build the command
        const command = `ansible-playbook ${playbookPath} ${extraParams}`;
        console.error(`Executing: ${command}`);
    
        // Execute the playbook asynchronously
        const { stdout, stderr } = await execAsync(command);
        
        // Return stdout, or a success message if stdout is empty
        return stdout || `${operationName} completed successfully (no output).`;
    
      } catch (error: any) {
        // Handle execution errors
        const errorMessage = error.stderr || error.message || 'Unknown error';
        throw new AnsibleExecutionError(`Ansible execution failed for ${operationName}: ${errorMessage}`, error.stderr);
      } finally {
        // Ensure cleanup happens even if errors occur
        if (tempDir) {
          await cleanupTempDirectory(tempDir);
        }
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'manage' which implies both read and write operations, but doesn't disclose behavioral traits like authentication requirements, rate limits, side effects of deletions, or response formats. This is inadequate for a tool with 10 parameters and multiple mutation actions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence. It's front-loaded with the core purpose and wastes no words. However, this conciseness comes at the cost of completeness for such a complex tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given high complexity (10 parameters, multiple actions including mutations), no annotations, and no output schema, the description is severely incomplete. It doesn't explain what the tool returns, how actions differ, or critical behavioral aspects needed for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only mentions 'DNS records and zones' generically, failing to explain the purpose of any parameters (like action, region, zoneId) or their relationships. This leaves all 10 parameters semantically undocumented beyond their schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Manage AWS Route53 DNS records and zones' states the general purpose (managing DNS resources) but is vague about specific actions. It doesn't distinguish this tool from potential sibling DNS management tools, though no direct siblings exist in the provided list. The verb 'manage' is broad rather than specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention any prerequisites, context for choosing among the multiple actions, or comparisons with other AWS tools. Users must infer usage from the action parameter alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/tarnover/mcp-sysoperator'

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