Skip to main content
Glama
ry-ops

Cloudflare MCP Server

by ry-ops

list_dns_records

List and filter DNS records for a Cloudflare zone by type, name, content, and paginate results.

Instructions

List DNS records for a zone. Can filter by type, name, content, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zone_idYesThe zone ID
typeNoDNS record type (A, AAAA, CNAME, TXT, MX, etc.)
nameNoDNS record name to filter by
contentNoDNS record content to filter by
pageNoPage number for pagination
per_pageNoNumber of records per page (max: 100)

Implementation Reference

  • Handler function that executes the 'list_dns_records' tool logic. Builds query parameters from optional args (type, name, content, page, per_page) and calls the Cloudflare API GET /zones/{zone_id}/dns_records.
    async def _list_dns_records(self, args: dict) -> Any:
        """List DNS records."""
        params = {}
        if args.get("type"):
            params["type"] = args["type"]
        if args.get("name"):
            params["name"] = args["name"]
        if args.get("content"):
            params["content"] = args["content"]
        if args.get("page"):
            params["page"] = args["page"]
        if args.get("per_page"):
            params["per_page"] = args["per_page"]
    
        return await self._make_request(
            f"/zones/{args['zone_id']}/dns_records", params=params
        )
  • Tool definition with input schema: requires zone_id, with optional filters for type, name, content, page, per_page.
    Tool(
        name="list_dns_records",
        description="List DNS records for a zone. Can filter by type, name, content, etc.",
        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 to filter by",
                },
                "content": {
                    "type": "string",
                    "description": "DNS record content to filter by",
                },
                "page": {
                    "type": "number",
                    "description": "Page number for pagination",
                },
                "per_page": {
                    "type": "number",
                    "description": "Number of records per page (max: 100)",
                },
            },
            "required": ["zone_id"],
        },
  • Tool dispatch in call_tool handler: routes the 'list_dns_records' name to the _list_dns_records method.
    elif name == "list_dns_records":
        result = await self._list_dns_records(arguments)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions filtering but omits important behavioral traits like pagination (page/per_page parameters exist but no mention of default behavior or limits), sorting, or any rate limits. Minimal disclosure for a listing endpoint.

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?

The description is a single, concise sentence that conveys the primary action. It is efficiently front-loaded but could include more detail in the same space.

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 6 parameters, no output schema, and no annotations, the description is too sparse. It does not explain pagination behavior, default values, sorting, or what happens when no filters are applied. This leaves gaps for an agent to use the tool correctly.

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 description coverage is 100%, so the schema already documents all parameters. The description adds 'etc.' but doesn't provide meaningful additional semantic context beyond listing a few filterable fields. Baseline 3 is appropriate.

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 tool lists DNS records for a zone, which is a specific verb and resource. However, it does not explicitly differentiate from sibling tools like create/delete/update_dns_record, though the purpose is fairly obvious.

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 guidance on when to use this vs alternatives. Usage is implied by the tool name and context (it's the listing tool among mutation ones), but no exclusions or prerequisites are mentioned.

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