Skip to main content
Glama

mcp-server-cloudflare

Official
by cloudflare
zone.api.ts1.18 kB
import type { Cloudflare } from 'cloudflare' export interface ZoneListParams { client: Cloudflare accountId: string page?: number perPage?: number direction?: 'asc' | 'desc' match?: 'any' | 'all' name?: string status?: string order?: string } /** * Lists zones under a Cloudflare account * @see https://developers.cloudflare.com/api/resources/zones/methods/list/ */ export async function handleZonesList({ client, accountId, page = 1, perPage = 50, direction = 'desc', match = 'all', name, status, order = 'name', }: ZoneListParams) { // Build query parameters const query: Record<string, string | number> = { page, per_page: perPage, direction, match, account_id: accountId, } // Only add these parameters if they're defined and not empty strings if (name) { query.name = name } if (status) { query.status = status } if (order) { query.order = order } try { // Use the zones.list method from the Cloudflare client const response = await client.zones.list({ query }) return response.result } catch (error) { throw new Error( `Failed to list zones: ${error instanceof Error ? error.message : String(error)}` ) } }

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/cloudflare/mcp-server-cloudflare'

If you have feedback or need assistance with the MCP directory API, please join our Discord server