gads_remove_ad_group
Google Ads write high risk
Part of the Google Ads Manager Agent.
What it does
Permanently remove an ad group via AdGroupService.MutateAdGroups remove operation (resource_name only; an irreversible status transition to REMOVED). All ads, keywords and criteria under it stop serving and the removal cannot be undone — a removed ad group can only be replaced by creating a new one. PREVIEW->APPROVE->COMMIT: validate_only=true dry run -> plain-English warning that removal is permanent and a list of what stops serving -> explicit approval -> execute with partial_failure=true -> confirm with UTC timestamp + audit log. Because this is destructive and not reversible, approval must be unambiguous. PREVIEW SEMANTICS: the first call (no preview_id) is sent to the Google Ads API in validation mode — field, enum, policy and permission errors surface AT PREVIEW, nothing is changed, and the response returns a preview_id. To apply, show the preview to the user, get their approval, and re-call with that preview_id and IDENTICAL arguments within 30 minutes; changed arguments or an expired token fail closed to a fresh preview. validate_only=true forces another preview; validate_only=false alone never commits.
When to use it
Use only when the user explicitly wants to permanently retire an ad group. Prefer pausing if there is any doubt — removal cannot be undone. Always preview with validate_only and require unambiguous approval before committing.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
ad_group_id | string | yes | Numeric ad group id; forms resource_name with customer_id. |
customer_id | string | yes | 10-digit CID, dashes stripped. |
confirm_irreversible | boolean | no | Required at APPLY: must be true together with preview_id or the commit is refused. Previews run without it and carry the IRREVERSIBLE warning (a removed ad group can never be re-enabled). |
validate_only | boolean | no | Optional. true forces another preview even with a preview_id; false is DEPRECATED and no longer commits — only a valid preview_id applies the write. |
preview_id | string | no | Omit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview. |
Safeguards
A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.
Policy
Do not remove an ad group as part of recreating disapproved content elsewhere to dodge enforcement (Circumventing Systems — egregious). Removal is permanent; never present it as recoverable.
Reminder
Removal is irreversible — confirm explicitly, log the reason, and never delete to mask a policy violation.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Customer ID not found / unauthorized. | Verify CID and authorization; re-auth if revoked. | no |
TOKEN_REVOKED | OAuth credential revoked/expired. | Prompt reconnect (needs_reauth). | no |
INVALID_ARGUMENT | Remove rejected (e.g. already removed, bad resource_name) — surfacing Google's message. | Surface exact error; verify the id and current state. | no |
PERMISSION_DENIED | Scope/role does not permit writes here. | Confirm adwords scope and editor role on this CID. | no |
MANAGER_ACCOUNT_WRITE | Cannot mutate ad groups on an MCC. | Target a client account. | no |
PARTIAL_FAILURE | A bulk remove partially succeeded: some ad groups removed, others rejected. | Return success:true with per-row warnings; report which removed and which failed. | no |
RESOURCE_EXHAUSTED | Rate/quota exceeded (429). | Backoff 5->10->20s cap 60s; honor retryDelay. | yes |
PLATFORM_UNAVAILABLE | Google Ads API 5xx. | Re-check state, then retry once to avoid duplicate ops. | yes |
Edge cases
- Already-REMOVED ad group -> INVALID_ARGUMENT; report it is already removed (treat as no-op, not failure).
- Removal cascades: all child ads/keywords stop serving — state this in the preview.
- Idempotency on commit: a retried remove after success should detect REMOVED state and not error the user.
- Bulk remove partial_failure -> success:true with warnings per failed row.
- Preview-state TTL expiry -> re-preview before commit.
- Expired token -> refresh once, retry.