Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_delete_security_rule

Remove a firewall security rule by specifying the zone name and rule ID, ensuring precise management of your Cloudflare DNS and security settings.

Instructions

Delete a firewall security rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rule_idYes
zone_nameYes

Implementation Reference

  • Handler function that parses input, resolves the Cloudflare zone ID from zone_name, deletes the WAF security rule by rule_id using the CloudflareClient, and returns a formatted MCP response confirming deletion.
      handler: async (params: z.infer<typeof DeleteSecurityRuleInputSchema>) => {
        const { zone_name, rule_id } = DeleteSecurityRuleInputSchema.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;
    
        const resp = await client.delete<{ id: string }>(`/zones/${zoneId}/firewall/rules/${rule_id}`);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ id: resp.id ?? rule_id, deleted: true }, null, 2)
            }
          ]
        };
      },
    };
  • Zod schema defining the input parameters: zone_name (string) and rule_id (string) for the tool.
    const DeleteSecurityRuleInputSchema = z.object({
      zone_name: z.string(),
      rule_id: z.string(),
    });
  • The delete_security_rule tool is registered within the tools object returned by getSecurityTools function.
      tools: {
        'cloudflare-dns-mcp/list_waf_rules': listWafRulesTool,
        'cloudflare-dns-mcp/create_security_rule': createSecurityRuleTool,
        'cloudflare-dns-mcp/update_security_rule': updateSecurityRuleTool,
        'cloudflare-dns-mcp/delete_security_rule': deleteSecurityRuleTool,
      },
    };
  • src/index.ts:18-32 (registration)
    Higher-level registration where securityTools (including delete_security_rule) are merged into the allTools object for the MCP server.
    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>;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Delete') but lacks critical details: it doesn't specify if deletion is permanent, requires specific permissions, has rate limits, or what happens on success/failure. This is inadequate for a destructive operation.

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, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse, though this conciseness comes at the cost of completeness.

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 destructive nature, 2 required parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks parameter explanations, behavioral context, and usage guidelines, making it inadequate for safe and effective use by an AI agent.

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 by explaining parameters. It mentions no parameters at all, leaving 'rule_id' and 'zone_name' undocumented. This fails to add meaning beyond the bare schema, which is insufficient for a tool with 2 required parameters.

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 ('Delete') and resource ('a firewall security rule'), making the tool's purpose immediately understandable. However, it doesn't distinguish this from sibling tools like 'cloudflare-dns-mcp_delete_dns_record' or 'cloudflare-dns-mcp_delete_page_rule' beyond the resource type, missing explicit differentiation.

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 an existing rule), exclusions, or compare it to related tools like 'cloudflare-dns-mcp_update_security_rule' or 'cloudflare-dns-mcp_list_waf_rules', 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

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