Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_list_page_rules

Retrieve and manage active or disabled redirect rules for a specified zone using structured commands, enabling efficient configuration and monitoring of Cloudflare page rules.

Instructions

List all page rules (redirects) for a zone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNo
zone_nameYes

Implementation Reference

  • Handler function that validates input using the schema, retrieves the zone ID by name, constructs a query for page rules with optional status filter, calls the Cloudflare API to list pagerules, and formats the JSON response in MCP content structure.
    handler: async (params: unknown) => {
      const { zone_name, status } = ListPageRulesInputSchema.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 query: any = {};
      if (status) query.status = status;
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(await client.get(`/zones/${zoneId}/pagerules`, query), null, 2)
          }
        ]
      };
    },
  • Zod input schema defining required zone_name (string) and optional status (enum: 'active' or 'disabled') for filtering page rules.
    const ListPageRulesInputSchema = z.object({ zone_name: z.string(), status: z.enum(['active','disabled']).optional() });
  • Local registration of the tool under its name in the getRedirectTools() function's returned tools object, which is later imported and spread into the global tools map in src/index.ts.
    'cloudflare-dns-mcp/list_page_rules': listPageRulesTool,
  • src/index.ts:25-30 (registration)
    Global aggregation of all tools including redirect tools (containing list_page_rules) into allTools object before mapping to sanitized names and registering with MCP server handlers.
    const allTools = {
      ...dnsTools.tools,
      ...securityTools.tools,
      ...sslCertTools.tools,
      ...echoTools.tools,
      ...redirectTools.tools,
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 it's a list operation, implying read-only and non-destructive behavior, but doesn't cover critical aspects like pagination, rate limits, error handling, or response format. For a 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 that front-loads the core action ('List all page rules') and resource. There is no wasted verbiage or redundancy, making it highly concise and well-structured for quick understanding.

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 (2 parameters, 0% schema coverage, no annotations, no output schema), the description is incomplete. It lacks details on parameter usage, behavioral traits like pagination, and output expectations. For a list tool with filtering options, this leaves the agent under-informed about how to effectively invoke and interpret results.

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?

The description mentions 'for a zone', which aligns with the required 'zone_name' parameter, adding some context. However, schema description coverage is 0%, and the description doesn't explain the optional 'status' parameter or its enum values ('active', 'disabled'). It partially compensates but leaves key parameters undocumented, meeting the baseline for moderate schema coverage.

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 'List' and resource 'page rules (redirects) for a zone', making the purpose specific and understandable. It distinguishes from siblings like 'list_dns_records' or 'list_zones' by focusing on page rules. However, it doesn't explicitly differentiate from 'list_ssl_certs' or 'list_waf_rules' beyond the resource name, which is why it's not a perfect 5.

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 authentication, compare to other list tools (e.g., 'list_dns_records'), or specify scenarios for filtering by status. This leaves the agent without context for selection among siblings.

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