Skip to main content
Glama
Cloudflare Workers MCP Server

Cloudflare Workers MCP Server

Add Worker Domain

add_worker_domain
Idempotent

Attach a custom domain to a Cloudflare Worker by routing a hostname to a Worker script. The zone must be active in the same account; DNS records and certificates are created automatically.

Instructions

Attach a custom domain to a Worker. The domain's zone must be active in this Cloudflare account (external zones are not supported); Cloudflare creates the DNS record and certificate automatically.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "hostname": "<hostname>",
      "service": "<service>"
    },
    "name": "add_worker_domain"
  }
}

Input Schema

NameRequiredDescriptionDefault
serviceYesThe Worker (script name) to route the hostname to
zone_idNoZone ID (the zone must be active in this account)
hostnameYesHostname to attach, e.g. app.example.com (zone apex or subdomain)
zone_nameNoZone name, e.g. example.com
environmentNoWorker environment (default: production)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

The annotations already declare a non-read-only, idempotent, open-world mutation; the description adds substantive context beyond them by disclosing the automatic side effects (Cloudflare creates the DNS record and certificate) and the account-scoped zone restriction. Return shape and propagation timing are not described, which keeps it off a 5.

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

Conciseness5/5

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

Two sentences, front-loaded with the action, then the prerequisite and side effects. Every clause carries information and nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with full schema coverage and annotations covering safety and idempotency, the description supplies the important missing context: prerequisites and automatic DNS/certificate creation. It omits what the call returns (the domain object) and failure modes for inactive zones, but the definition is largely sufficient.

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 hostname, service, zone_id, zone_name, and environment are already documented inline. The description's only parameter-adjacent contribution (the zone must be active in this account) duplicates the zone_id description, so baseline 3 applies.

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 opens with a specific verb and resource ('Attach a custom domain to a Worker') that clearly separates it from delete_worker_domain and list_worker_domains. It doesn't name those siblings explicitly, but the operation is unambiguous.

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?

It gives the key precondition for use: the domain's zone must be active in this account, and external zones are not supported. It doesn't say when to prefer it over list_worker_domains for verification or what to do on conflict, so it stops short of explicit alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.