Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_delete_page_rule

Delete a Cloudflare page rule by specifying the zone name and rule ID to manage DNS, security, or redirection settings efficiently.

Instructions

Delete a page rule by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rule_idYes
zone_nameYes

Implementation Reference

  • The main handler function that parses input, resolves the zone ID via Cloudflare API, deletes the page rule, and returns a confirmation in MCP format.
    handler: async (params: unknown) => {
      const { zone_name, rule_id } = DeletePageRuleInputSchema.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}/pagerules/${rule_id}`);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ id: rule_id, deleted: true }, null, 2)
          }
        ]
      };
    },
  • Zod input schema definition and JSON schema for input/output, including tool name and description.
    const DeletePageRuleInputSchema = z.object({ zone_name: z.string(), rule_id: z.string() });
    
    const deletePageRuleTool: Tool = {
      name: 'cloudflare-dns-mcp/delete_page_rule',
      description: 'Delete a page rule by ID',
      inputSchema: zodToJsonSchema(DeletePageRuleInputSchema) as any,
      outputSchema: {
        type: 'object',
        properties: { id: { type: 'string' }, deleted: { type: 'boolean' } },
        required: ['id', 'deleted'],
      } as any,
  • Registration of the tool in the module's tools record, returned by getRedirectTools.
    return { tools: {
        'cloudflare-dns-mcp/list_page_rules': listPageRulesTool,
        'cloudflare-dns-mcp/create_redirect': createRedirectTool,
        'cloudflare-dns-mcp/delete_page_rule': deletePageRuleTool,
      } };
  • src/index.ts:25-32 (registration)
    Global registration where redirect tools (including delete_page_rule) are merged into the allTools object used by the MCP server.
    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 but only states the action without behavioral details. It doesn't disclose that this is a destructive operation (implied by 'Delete'), potential side effects, authentication needs, error conditions, or response format, leaving significant gaps.

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, efficiently conveying the core action. It's appropriately sized and front-loaded for a simple operation.

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?

For a destructive tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks critical context like behavioral risks, parameter meanings, and expected outcomes, making it inadequate 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 but adds no parameter information. It doesn't explain what 'rule_id' or 'zone_name' represent, their formats, or how to obtain them, failing to address the undocumented 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 action ('Delete') and resource ('a page rule by ID'), making the purpose unambiguous. It doesn't explicitly differentiate from sibling tools like 'cloudflare-dns-mcp_delete_dns_record' or 'cloudflare-dns-mcp_delete_security_rule', but the resource specificity is inherent in the tool name.

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 page rule ID from 'cloudflare-dns-mcp_list_page_rules'), exclusions, or contextual cues for invocation.

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