Skip to main content
Glama
gilberth

MCP Cloudflare DNS Server

get_dns_record

Retrieve a specific DNS record by its unique ID using this tool, designed for managing Cloudflare DNS records through the MCP Cloudflare DNS Server.

Instructions

Get a specific DNS record by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordIdYesThe DNS record ID

Implementation Reference

  • The MCP tool handler for 'get_dns_record'. Configures API, fetches record via CloudflareApi.getDnsRecord, formats and returns text response.
      const handleGetDnsRecord = async (args: { recordId: string }) => {
        try {
          if (!configureApiIfNeeded()) {
            return {
              content: [{ type: "text", text: "āŒ Configuration incomplete. Please configure Cloudflare API Token and Zone ID first." }],
            };
          }
          
          const record = await CloudflareApi.getDnsRecord(args.recordId);
          
          return {
            content: [{ 
              type: "text", 
              text: `āœ… DNS Record Details:
    šŸ”¹ Name: ${record.name}
    šŸ”¹ Type: ${record.type}
    šŸ”¹ Content: ${record.content}
    šŸ”¹ TTL: ${record.ttl}
    šŸ”¹ Proxied: ${record.proxied ? 'Yes' : 'No'}
    ${record.priority ? `šŸ”¹ Priority: ${record.priority}` : ''}
    šŸ”¹ ID: ${record.id}
    šŸ”¹ Created: ${new Date(record.created_on).toLocaleString()}
    šŸ”¹ Modified: ${new Date(record.modified_on).toLocaleString()}`
            }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `āŒ Error getting DNS record: ${error instanceof Error ? error.message : 'Unknown error'}` }],
          };
        }
      };
  • Core Cloudflare API helper that makes the HTTP GET request to retrieve a specific DNS record by its ID.
    getDnsRecord: async (recordId: string): Promise<DnsRecord> => {
      const response = await api(`dns_records/${recordId}`);
      const data = CloudflareApiResponse.parse(await response.json());
      
      if (!data.success) {
        throw new Error(`API Error: ${data.errors.map(e => e.message).join(', ')}`);
      }
      
      if (!data.result || Array.isArray(data.result)) {
        throw new Error('DNS record not found');
      }
      
      return data.result;
    },
  • src/index.ts:67-80 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema for 'get_dns_record'.
    {
      name: "get_dns_record",
      description: "Get a specific DNS record by ID",
      inputSchema: {
        type: "object",
        properties: {
          recordId: {
            type: "string",
            description: "The DNS record ID",
          },
        },
        required: ["recordId"],
      },
    },
  • Input schema definition for the 'get_dns_record' tool as part of its registration.
    {
      name: "get_dns_record",
      description: "Get a specific DNS record by ID",
      inputSchema: {
        type: "object",
        properties: {
          recordId: {
            type: "string",
            description: "The DNS record ID",
          },
        },
        required: ["recordId"],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is a read-only operation, error handling, permissions required, or response format, which are critical for a tool with mutation siblings.

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 a single, efficient sentence with zero waste, clearly front-loaded with the core action. It's appropriately sized for a simple tool, making it easy to parse quickly.

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 the complexity (no annotations, no output schema, and siblings include mutations), the description is incomplete. It lacks behavioral context, usage guidelines, and output details, making it inadequate for safe and effective tool selection in this environment.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already documents the 'recordId' parameter. The description adds no additional meaning beyond implying retrieval by ID, aligning with the baseline for high schema coverage without extra param insights.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('a specific DNS record by ID'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'list_dns_records' or 'update_dns_record' beyond the basic action, missing explicit sibling distinction.

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. It doesn't mention prerequisites (e.g., needing a record ID), exclusions, or comparisons to siblings like 'list_dns_records' for broader queries, leaving usage context unclear.

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/gilberth/mcp-cloudflare'

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