Skip to main content
Glama
ry-ops

Cloudflare MCP Server

by ry-ops

create_dns_record

Create a new DNS record in a Cloudflare zone, supporting all record types like A, AAAA, CNAME, TXT, MX, and more.

Instructions

Create a new DNS record in a zone. Supports all DNS record types.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zone_idYesThe zone ID
typeYesDNS record type (A, AAAA, CNAME, TXT, MX, etc.)
nameYesDNS record name (e.g., 'www' or '@' for root)
contentYesDNS record content (e.g., IP address, hostname)
ttlNoTime to live (1 = automatic, or 120-86400 seconds)
proxiedNoWhether the record is proxied through Cloudflare (only for A, AAAA, CNAME)
priorityNoPriority (for MX, SRV records)
commentNoComment for the DNS record

Implementation Reference

  • The handler function `_create_dns_record` that executes the create DNS record tool logic. It builds a data payload from required fields (type, name, content, ttl) and optional fields (proxied, priority, comment), then POSTs to the Cloudflare API endpoint `/zones/{zone_id}/dns_records`.
    async def _create_dns_record(self, args: dict) -> Any:
        """Create DNS record."""
        data = {
            "type": args["type"],
            "name": args["name"],
            "content": args["content"],
            "ttl": args.get("ttl", 1),
        }
    
        if "proxied" in args:
            data["proxied"] = args["proxied"]
        if "priority" in args:
            data["priority"] = args["priority"]
        if "comment" in args:
            data["comment"] = args["comment"]
    
        return await self._make_request(
            f"/zones/{args['zone_id']}/dns_records", method="POST", data=data
        )
  • The input schema definition for the create_dns_record tool, listing required fields (zone_id, type, name, content) and optional fields (ttl, proxied, priority, comment) with their types and descriptions.
    Tool(
        name="create_dns_record",
        description="Create a new DNS record in a zone. Supports all DNS record types.",
        inputSchema={
            "type": "object",
            "properties": {
                "zone_id": {
                    "type": "string",
                    "description": "The zone ID",
                },
                "type": {
                    "type": "string",
                    "description": "DNS record type (A, AAAA, CNAME, TXT, MX, etc.)",
                },
                "name": {
                    "type": "string",
                    "description": "DNS record name (e.g., 'www' or '@' for root)",
                },
                "content": {
                    "type": "string",
                    "description": "DNS record content (e.g., IP address, hostname)",
                },
                "ttl": {
                    "type": "number",
                    "description": "Time to live (1 = automatic, or 120-86400 seconds)",
                    "default": 1,
                },
                "proxied": {
                    "type": "boolean",
                    "description": "Whether the record is proxied through Cloudflare (only for A, AAAA, CNAME)",
                    "default": False,
                },
                "priority": {
                    "type": "number",
                    "description": "Priority (for MX, SRV records)",
                },
                "comment": {
                    "type": "string",
                    "description": "Comment for the DNS record",
                },
            },
            "required": ["zone_id", "type", "name", "content"],
        },
  • The tool registration in the call_tool handler dispatcher, routing the name 'create_dns_record' to the `_create_dns_record` method.
    elif name == "create_dns_record":
        result = await self._create_dns_record(arguments)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must cover behavioral traits. Only mentions 'supports all types', but omits validation, permissions, conflict handling, and side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is efficient, though it could include a brief context sentence. No redundancy.

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?

With 8 parameters and no output schema, description does not cover return value, error cases, or usage examples, leaving gaps for agent understanding.

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?

Schema coverage is 100% (baseline 3). Description adds no extra information beyond schema, which fully documents parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states action (Create), resource (DNS record), and context (in a zone). Supports all types distinguishes from siblings like delete, update, list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use vs alternatives. Implies creation but doesn't contrast with update or list. Lacks exclusion criteria.

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

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

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