Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_list_zones

List all zones in a Cloudflare account with optional status filtering and detailed inclusion, using a structured tool for DNS and zone management.

Instructions

List all zones in the account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_detailsNo
status_filterNo

Implementation Reference

  • Primary handler implementation for the 'cloudflare-dns-mcp/list_zones' tool. Fetches zones with optional status filter, optionally enriches with zone settings.
    handler: async (params: any) => {
      const { status_filter, include_details } = ListZonesInputSchema.parse(params);
      const query: Record<string, any> = {};
      if (status_filter) query.status = status_filter;
      const zones = await client.get<any[]>('/zones', query);
      if (!include_details) return zones;
      // fetch settings for each zone in parallel (limit concurrency if desired)
      const enriched = await Promise.all(
        zones.map(async z => {
          const settings = await client.get(`/zones/${z.id}/settings`);
          return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ ...z, settings }, null, 2)
          }
        ]
      };
        }),
      );
      return enriched;
    },
  • Zod input schema for list_zones tool defining optional status_filter and include_details parameters.
    const ListZonesInputSchema = z.object({
      status_filter: z.string().optional(),
      include_details: z.boolean().optional().default(false),
    });
  • Output schema for list_zones tool (array of zone objects).
    outputSchema: { type: 'array', items: {} } as any,
  • src/index.ts:21-32 (registration)
    Registration in main server index.ts where zoneTools (containing list_zones) are merged into allTools. Note: overrides duplicate from dnsTools.
    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>;
  • Local registration of listZonesTool in getZoneManagementTools export.
    'cloudflare-dns-mcp/list_zones': listZonesTool,
  • Duplicate simpler handler in dns-records.ts (overridden by zone-management version).
    handler: async () => {
      const zones = await client.get<Array<z.infer<typeof ZoneSchema>>>('/zones');
      return zones.map(z => ({ id: z.id, name: z.name, status: z.status }));
    },
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 basic action. It doesn't disclose behavioral traits like pagination, rate limits, authentication needs, or what 'zones' entails (e.g., Cloudflare DNS zones). This is inadequate for a tool with parameters and no annotation coverage.

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 appropriately sized and front-loaded, making it easy to parse quickly.

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 2 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what zones are, how results are returned, or parameter usage, leaving the agent with insufficient context for effective tool 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?

The description mentions no parameters, while the schema has 2 parameters with 0% coverage. It doesn't explain 'include_details' or 'status_filter', failing to compensate for the low schema coverage. For 2 undocumented parameters, this is a significant gap.

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 ('List all') and resource ('zones in the account'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_dns_records' or 'list_ssl_certs' which also list resources, so it lacks sibling distinction.

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, context, or exclusions, leaving the agent to infer usage from the tool name 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