gads_remove_label
Google Ads write low risk
Part of the Account Structure Agent.
What it does
Remove a label association from campaigns/ad groups/ads (remove operations on the *LabelService using the association resource path adGroupAdLabel/campaignLabel/adGroupLabel), OR delete the label entirely (LabelService remove) when delete_label=true. Removing an association unlinks the label; deleting the label removes it and all its associations, irreversibly: that preview carries an IRREVERSIBLE warning and its commit needs the preview_id AND confirm_irreversible=true (an unlink needs no flag). WRITE with preview->approve->commit: preview = mutate validate_only=true + diff (what is being unlinked/deleted) + preview_id; commit = the same call plus that preview_id after the user approves in a later message (+ partial_failure for bulk unlink) + audit. Returns {label_id, entities_unlabeled or deleted}. 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.
When to use it
Use to unlink a label from specific entities, or to delete a label entirely. Preview to show exactly what is unlinked/deleted, confirm (especially for full delete), then commit.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. |
label_id | string | yes | Label ID to unlink or delete. |
delete_label | boolean | no | If true, delete the label entirely (removes all associations). If false/omitted, only unlink from the given entities. |
entity_type | string | no | CAMPAIGN, AD_GROUP, or AD_GROUP_AD (alias: AD; case-insensitive) — selects the label link resource. |
campaign_ids | array | no | Campaign IDs to unlink (entity_type=CAMPAIGN). |
ad_group_ids | array | no | Ad group IDs to unlink (entity_type=AD_GROUP). |
ad_group_ad_ids | array | no | To unlink for entity_type=AD_GROUP_AD. Each item may be {ad_group_id, ad_id}, 'adGroupId~adId', or a full ad_group_ad resource_name - all three are accepted. |
manager_id | string | no | Optional MCC login-customer-id. |
confirm_irreversible | boolean | no | Required at APPLY when delete_label=true: must be true together with preview_id or the delete is refused. That preview carries the IRREVERSIBLE warning (a deleted label cannot be restored). Not needed to unlink. |
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
Deleting a label is irreversible and strips it from every entity; confirm the user intends a full delete vs a targeted unlink. Organizational only.
Reminder
Deleting a label removes it everywhere; confirm delete vs unlink before committing.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
PARTIAL_FAILURE | Some unlink rows referenced a non-existent association while others succeeded. | Report failed indices; the rest were unlinked. | no |
VALIDATION_ERROR | Neither delete_label nor an entity list provided. | Set delete_label=true or provide entities to unlink. | no |
NOT_FOUND | Label or association does not exist. | Confirm the label_id and associations via gads_list_labels. | no |
TOKEN_REVOKED | OAuth token expired/revoked. | Refresh and retry once; else prompt reconnect (needs_reauth). | yes |
PERMISSION_DENIED | No access or out-of-bearer-scope write. | Confirm access and write scope; else refuse. | no |
RESOURCE_EXHAUSTED | Rate/quota exceeded (HTTP 429). | Backoff 5/10/20s cap 60s, then retry. | yes |
INTERNAL_ERROR | Transient Google server error (5xx). | Retry after backoff. | yes |
Edge cases
- delete_label=true is irreversible and removes the label from all entities -> require explicit confirmation.
- Unlinking an association that doesn't exist -> per-row not-found (partial failure).
- Bulk unlink must respect the 10,000-op mutate cap; chunk if needed.
- Without delete_label or entities -> VALIDATION_ERROR.
- Preview changes nothing; preview_id TTL expiry -> re-preview; expired token -> refresh once and retry.