Skip to main content
Glama
ry-ops

Cloudflare MCP Server

by ry-ops

get_zone

Retrieve detailed information about a Cloudflare zone by providing its zone ID.

Instructions

Get detailed information about a specific zone by zone ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zone_idYesThe zone ID

Implementation Reference

  • The handler function _get_zone that executes the get_zone tool logic. It makes a GET request to /zones/{zone_id} to retrieve zone details.
    async def _get_zone(self, args: dict) -> Any:
        """Get zone details."""
        return await self._make_request(f"/zones/{args['zone_id']}")
  • Tool definition and input schema for get_zone, requiring a zone_id string parameter.
    Tool(
        name="get_zone",
        description="Get detailed information about a specific zone by zone ID",
        inputSchema={
            "type": "object",
            "properties": {
                "zone_id": {
                    "type": "string",
                    "description": "The zone ID",
                }
            },
            "required": ["zone_id"],
        },
  • Registration of get_zone in the call_tool handler dispatch, mapping the name to _get_zone.
    elif name == "get_zone":
        result = await self._get_zone(arguments)
  • The _make_request helper function that all tool handlers use to communicate with the Cloudflare API.
    async def _make_request(
        self,
        endpoint: str,
        method: str = "GET",
        data: Optional[dict] = None,
        params: Optional[dict] = None,
    ) -> Any:
        """Make a request to the Cloudflare API."""
        url = f"{CLOUDFLARE_API_BASE}{endpoint}"
        headers = {
            "Authorization": f"Bearer {self.api_token}",
            "Content-Type": "application/json",
        }
    
        try:
            response = await self.client.request(
                method=method,
                url=url,
                json=data,
                params=params,
                headers=headers,
            )
            response.raise_for_status()
            result = response.json()
    
            if not result.get("success"):
                errors = result.get("errors", [])
                raise Exception(f"Cloudflare API error: {json.dumps(errors)}")
    
            return result.get("result")
    
        except httpx.HTTPError as e:
            raise Exception(f"HTTP error occurred: {str(e)}")
Behavior2/5

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

No annotations are provided, so the description carries full responsibility. It fails to disclose behavioral traits such as read-only nature, error conditions, rate limits, or what 'detailed information' encompasses.

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, clear sentence with no extraneous information. It is appropriately concise for a simple retrieval tool, though could benefit from slight expansion.

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?

Given no output schema and minimal description, the agent lacks information about the return format or fields. 'Detailed information' is vague, making the tool less complete for accurate invocation.

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?

The input schema fully describes the single parameter (zone_id) with 'The zone ID'. The description adds 'by zone ID' which reinforces but does not add beyond the schema. Baseline 3 is appropriate.

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?

The description clearly states the action ('Get detailed information'), the resource ('a specific zone'), and the discriminator ('by zone ID'). It effectively distinguishes from sibling tools like list_zones and get_zone_analytics.

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

Usage Guidelines4/5

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

The description implies usage when a zone ID is known, but does not explicitly contrast with sibling tools or state when not to use. The guidance is clear but not exhaustive.

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