Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_update_zone_settings

Modify DNS zone settings by providing a zone name and updated configuration. This tool enables direct management of Cloudflare DNS, security, and redirects for optimized domain performance.

Instructions

Update settings for a zone (destructive operation)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
settingsYes
zone_nameYes

Implementation Reference

  • The main handler function that performs the Cloudflare zone settings update by finding the zone ID, preparing the settings items, and making a PATCH request to the Cloudflare API.
    handler: async (params: any) => {
      const { zone_name, settings } = UpdateZoneSettingsInputSchema.parse(params);
      const zones = await client.get<any[]>('/zones', { name: zone_name });
      if (zones.length === 0) throw new Error(`Zone ${zone_name} not found`);
      const zoneId = zones[0].id;
      const items = Object.entries(settings).map(([id, value]) => ({ id, value }));
      const body = { items };
      const cfClient: any = client as any;
      if (typeof cfClient.patch === 'function') {
        return {
        content: [
          {
            type: "text",
            text: JSON.stringify(await cfClient.patch(`/zones/${zoneId}/settings`, body), null, 2)
          }
        ]
      };
      }
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(await cfClient.request("PATCH", `/zones/${zoneId}/settings`, body), null, 2)
          }
        ]
      };
    },
  • Zod input schema for the tool, extending the base zone_name schema with a settings object. Base schema defined earlier at lines 46-48.
    // update_zone_settings
    const UpdateZoneSettingsInputSchema = GetZoneSettingsInputSchema.extend({
      settings: z.record(z.any()),
    });
  • Local registration of the update_zone_settings tool within the zone-management tools module.
    return {
      tools: {
        'cloudflare-dns-mcp/list_zones': listZonesTool,
        'cloudflare-dns-mcp/get_zone_settings': getZoneSettingsTool,
        'cloudflare-dns-mcp/update_zone_settings': updateZoneSettingsTool,
        'cloudflare-dns-mcp/purge_cache': purgeCacheTool,
      },
    };
  • src/index.ts:25-32 (registration)
    Global aggregation of all tools including zoneTools (which contains update_zone_settings) into allTools object.
    const allTools = {
      ...dnsTools.tools,
      ...securityTools.tools,
      ...sslCertTools.tools,
      ...echoTools.tools,
      ...redirectTools.tools,
      ...zoneTools.tools,
    } as Record<string, any>;
  • src/index.ts:48-52 (registration)
    Registration under sanitized tool name 'cloudflare-dns-mcp_update_zone_settings' by replacing '/' with '_' for MCP server compatibility.
    const toolsMap: Record<string, any> = {};
    for (const tool of Object.values(allTools)) {
      const safeName = tool.name.replace(/[^a-zA-Z0-9_-]/g, '_');
      toolsMap[safeName] = tool;
    }
Behavior3/5

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

The description adds valuable behavioral context by explicitly labeling this as a 'destructive operation', which is crucial since no annotations are provided. However, it doesn't disclose other important traits like authentication requirements, rate limits, whether changes are reversible, or what the response looks like. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior.

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 at just 7 words, front-loading the core purpose ('Update settings for a zone') followed by critical behavioral warning ('destructive operation'). Every word earns its place with zero redundancy or unnecessary elaboration.

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 this is a destructive mutation tool with 2 parameters (one being a complex nested object), 0% schema coverage, no annotations, and no output schema, the description is inadequate. It warns about destructiveness but doesn't explain what settings can be updated, how to format them, what happens on success/failure, or provide any examples. The agent lacks sufficient information to use this tool effectively.

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?

With 0% schema description coverage, the description carries full burden for explaining parameters but provides minimal help. It mentions 'settings' and 'zone_name' implicitly but doesn't explain what settings are available, their format, or what zone_name represents. The description fails to compensate for the schema's lack of documentation, leaving both parameters poorly understood.

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 ('Update') and resource ('settings for a zone'), making the purpose immediately understandable. It distinguishes from siblings like 'get_zone_settings' (read vs. write) and 'update_dns_record' (settings vs. DNS records). However, it doesn't specify which settings can be updated, leaving some ambiguity compared to more specific sibling tools.

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 (e.g., needing zone_name from list_zones), compare to update_dns_record for DNS-specific changes, or clarify when settings updates are appropriate versus other operations. The agent must infer usage from context 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

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