Add Worker Domain
add_worker_domainAttach 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
| Name | Required | Description | Default |
|---|---|---|---|
| service | Yes | The Worker (script name) to route the hostname to | |
| zone_id | No | Zone ID (the zone must be active in this account) | |
| hostname | Yes | Hostname to attach, e.g. app.example.com (zone apex or subdomain) | |
| zone_name | No | Zone name, e.g. example.com | |
| environment | No | Worker environment (default: production) |