preflight_cloudflare_hosting
Verify a Cloudflare hosting choice and hostname are deployable before creating anything. Preflight checks DNS, zones, and permissions read-only, blocking invalid deployments with clear fix instructions.
Instructions
Check that a hosting choice and hostname can actually be deployed, before create_stack or create_deployment. Read-only: it never creates, deletes or takes over anything. It answers for the managed choice too, so call it the same way whichever option the user picked.
How to use the result:
ok: true— deployable. ReportconnectionLabel, andhostname/workerNamewhen present.notemay add useful context (for example that an apex hostname is supported).ok: false— do not create anything. Show the userblockingMessageverbatim; it names the exact collision and what to fix in Cloudflare. Resolve it with the user, then call this again.warningsare non-blocking (a check that could not be run) — surface them, but they do not stop the deployment.
For a customer choice, hostname must be a domain that already lives in one of that account's zones. An autogenerated Staticbot subdomain cannot be used, and an apex such as example.com is supported. The answer can go stale — permissions and DNS can change — so call it again after any change the user makes, and never treat a previous result as permission.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| choice | Yes | The `value` of the chosen option from list_cloudflare_hosting_targets — either its `managed.value` or a `customerOptions[].value`. Pass it through unchanged. | |
| hostname | Yes | The hostname the app will serve, e.g. 'example.com' or 'app.example.com'. Required for a customer account (apex is supported); ignored for the managed choice. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Parsed JSON response from the Staticbot public API |