Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_delete_dns_record

Remove a DNS record from a specified zone using its unique ID, enabling streamlined DNS management within the Cloudflare MCP Server.

Instructions

Delete a DNS record by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
record_idYes
zone_nameYes

Implementation Reference

  • The core handler function that validates input parameters, looks up the zone ID from the zone name, and performs the DELETE request to Cloudflare's DNS records API endpoint.
    handler: async (params: z.infer<typeof DeleteDnsRecordInputSchema>) => {
      const { zone_name, record_id } = DeleteDnsRecordInputSchema.parse(params);
      const zones = await client.get<Array<{ id: string; name: string }>>('/zones', { name: zone_name });
      if (zones.length === 0) throw new Error(`Zone ${zone_name} not found`);
      const zoneId = zones[0].id;
      await client.delete(`/zones/${zoneId}/dns_records/${record_id}`);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ success: true, id: record_id }, null, 2)
          }
        ]
      };
    },
  • Zod input schema defining required parameters: zone_name (string) and record_id (string). Converted to JSON schema for the tool's inputSchema.
    const DeleteDnsRecordInputSchema = z.object({ zone_name: z.string(), record_id: z.string() });
  • Local registration of the tool object in the getDnsTools() return value using the slash-separated name.
    'cloudflare-dns-mcp/delete_dns_record': deleteDnsRecordTool,
  • src/index.ts:18-32 (registration)
    Main server registration: calls getDnsTools and spreads DNS tools into the combined allTools map used for MCP server toolset.
    const dnsTools = getDnsTools(cfClient);
    const securityTools = getSecurityTools(cfClient);
    const sslCertTools = getSslCertTools(cfClient);
    const zoneTools = getZoneManagementTools(cfClient);
    const echoTools = getEchoTools();
    const redirectTools = getRedirectTools(cfClient);
    
    const allTools = {
      ...dnsTools.tools,
      ...securityTools.tools,
      ...sslCertTools.tools,
      ...echoTools.tools,
      ...redirectTools.tools,
      ...zoneTools.tools,
    } as Record<string, any>;
  • Helper function that sanitizes tool names, replacing '/' with '_', creating the exact queried name 'cloudflare-dns-mcp_delete_dns_record' from 'cloudflare-dns-mcp/delete_dns_record'.
      const safeName = tool.name.replace(/[^a-zA-Z0-9_-]/g, '_');
      toolsMap[safeName] = tool;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action is 'Delete,' which implies a destructive mutation, but doesn't specify whether this is irreversible, requires specific permissions, or has side effects (e.g., DNS propagation delays). For a destructive tool with zero annotation coverage, this is a significant gap in transparency.

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. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, and there's no redundant or verbose phrasing.

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 tool's complexity (destructive mutation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like irreversibility, error conditions, or what happens post-deletion. For a delete operation in a DNS context, more context is needed to ensure safe and correct usage.

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 for undocumented parameters. It mentions 'by ID,' which hints at the 'record_id' parameter, but doesn't explain 'zone_name' or provide any context about parameter formats, sources, or relationships. With 2 parameters and no schema descriptions, the description adds minimal value beyond naming one parameter.

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 action ('Delete') and resource ('DNS record by ID'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'update_dns_record' by specifying deletion rather than modification. However, it doesn't explicitly mention the zone context, which is implied but could be more 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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like needing to identify a record ID first via 'list_dns_records'), nor does it clarify when deletion is appropriate versus updating or other operations. No explicit alternatives or exclusions are provided.

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

Related 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/jeffgolden/cloudflare_mcp'

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