cloudflare-dns-mcp_list_zone_settings
Retrieve and manage DNS, security, and redirect settings for a specified zone on Cloudflare. Streamlines configuration and monitoring tasks for AI-assisted automation.
Instructions
Retrieve all settings for a specific zone
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zone_name | Yes |
Implementation Reference
- src/tools/dns-records.ts:133-138 (handler)The core handler function for the tool. It validates the input zone_name, queries Cloudflare zones API to get zone ID, then fetches and returns the zone settings from /zones/{zoneId}/settings endpoint.const { zone_name } = ListZoneSettingsInputSchema.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 settings = await client.get<any>(`/zones/${zones[0].id}/settings`); return settings; },
- src/tools/dns-records.ts:127-127 (schema)Zod input schema definition requiring a 'zone_name' string parameter. The inputSchema and outputSchema are derived from this and set on the tool object.const listZoneSettingsTool: Tool = {
- src/tools/dns-records.ts:335-335 (registration)Local registration of the tool object within the 'tools' record returned by getDnsTools(client) function.'cloudflare-dns-mcp/list_zone_settings': listZoneSettingsTool,
- src/index.ts:25-31 (registration)Aggregation of all tools objects, including dnsTools.tools (which contains the list_zone_settings tool), into a single allTools map used by the MCP server.const allTools = { ...dnsTools.tools, ...securityTools.tools, ...sslCertTools.tools, ...echoTools.tools, ...redirectTools.tools, ...zoneTools.tools,
- src/index.ts:48-52 (helper)Helper code that sanitizes tool names by replacing non-alphanumeric chars (like '/') with '_', transforming 'cloudflare-dns-mcp/list_zone_settings' to 'cloudflare-dns-mcp_list_zone_settings' for client use.const toolsMap: Record<string, any> = {}; for (const tool of Object.values(allTools)) { const safeName = tool.name.replace(/[^a-zA-Z0-9_-]/g, '_'); toolsMap[safeName] = tool; }