cloudflare-dns-mcp_get_zone_settings
Retrieve the complete settings object for a specified Cloudflare DNS zone using structured inputs to streamline configuration management and analysis.
Instructions
Get full settings object for a zone
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zone_name | Yes |
Implementation Reference
- src/tools/zone-management.ts:55-68 (handler)The handler function for the 'cloudflare-dns-mcp/get_zone_settings' tool. It resolves the zone ID by name, fetches the settings from Cloudflare API, and returns them in MCP content format.handler: async (params: any) => { const { zone_name } = GetZoneSettingsInputSchema.parse(params); const zones = await client.get<any[]>('/zones', { name: zone_name }); if (zones.length === 0) throw new Error(`Zone ${zone_name} not found`); const zoneId = zones[0].id; return { content: [ { type: "text", text: JSON.stringify(await client.get(`/zones/${zoneId}/settings`), null, 2) } ] }; },
- src/tools/zone-management.ts:46-48 (schema)Zod input schema for the get_zone_settings tool, requiring a zone_name string.const GetZoneSettingsInputSchema = z.object({ zone_name: z.string(), });
- src/tools/zone-management.ts:152-159 (registration)Local registration of the get_zone_settings tool within the getZoneManagementTools function.return { tools: { 'cloudflare-dns-mcp/list_zones': listZonesTool, 'cloudflare-dns-mcp/get_zone_settings': getZoneSettingsTool, 'cloudflare-dns-mcp/update_zone_settings': updateZoneSettingsTool, 'cloudflare-dns-mcp/purge_cache': purgeCacheTool, }, };
- src/index.ts:48-52 (registration)Global tool registration where tool names are sanitized (slashes replaced with underscores, e.g., 'cloudflare-dns-mcp/get_zone_settings' becomes 'cloudflare-dns-mcp_get_zone_settings') and added to the toolsMap used by the MCP server.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; }
- src/index.ts:25-31 (registration)Merging of zone management tools (including get_zone_settings) into the allTools object in the main server entry point.const allTools = { ...dnsTools.tools, ...securityTools.tools, ...sslCertTools.tools, ...echoTools.tools, ...redirectTools.tools, ...zoneTools.tools,