deploy_worker
Deploy a Worker script from ES module source. Requires human confirmation to execute; otherwise returns a preview.
Instructions
Create or update (deploy) a Worker script from ES module source. Requires confirm:true (human-approval gate); without it returns a preview only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | No | Cloudflare account ID. Falls back to CLOUDFLARE_ACCOUNT_ID env var when omitted. | |
| script_name | Yes | The Worker script name to create/update. | |
| script | Yes | The Worker source code (ES module format). | |
| main_module | No | Entry module filename. Default 'worker.js'. | |
| compatibility_date | No | Compatibility date, e.g. 2024-01-01. | |
| confirm | No | Human-approval gate: must be true to actually perform this mutating operation. Omit or set false to get a non-executing preview of what would happen (with secrets redacted). A human should approve before this is set to true. |