gads_remove_search_themes
Google Ads write medium risk
Part of the Performance Max Agent.
What it does
Remove search-theme AssetGroupSignal rows from a PMax asset group via AssetGroupSignalService.MutateAssetGroupSignals (remove). Accepts explicit signal resource names or theme text to resolve. Returns {removed:[...], not_found:[...]}. Since AssetGroupSignals are immutable, removal is how you 'edit' a theme (remove + re-add). Flow: preview (validate_only=true) -> diff (themes to remove) -> approval -> execute (partial_failure=true) -> confirm + immutable audit log. Idempotent on already-removed signals. 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 to retire low-performing or off-strategy search themes, or as the first half of editing a theme (remove then re-add). Preview which themes will be removed and confirm before executing.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. |
asset_group_resource_name | string | no | Group to resolve theme text against (required if removing by text). |
signal_resource_names | array | no | Explicit AssetGroupSignal resources to remove. Provide this OR search_themes text. |
search_themes | array | no | Theme strings to match-and-remove within the group. |
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
Removing themes alters PMax targeting hints; do not churn themes to evade a policy finding (Circumventing Systems). Apply only the approved removals.
Reminder
No user data involved; account-isolated; nothing retained beyond this request.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
INVALID_ARGUMENT | Neither signal_resource_names nor search_themes(+group) supplied. | Provide resources or theme text + group. | no |
NOT_FOUND | Signal/theme not present on the group. | Idempotent success; report in not_found. | no |
TOKEN_REVOKED | Token revoked/expired. | Set needs_reauth; prompt reconnect. | no |
RESOURCE_EXHAUSTED | Quota/QPS exceeded (HTTP 429). | Backoff 5/10/20s cap 60s, retry once. | yes |
PARTIAL_FAILURE | Some removals failed. | Return per-signal errors. | no |
PLATFORM_UNAVAILABLE | Backend 5xx/INTERNAL. | Retry once after backoff. | yes |
Edge cases
- Theme text not exactly matching the stored signal -> reported in not_found (case/whitespace sensitive); resolve via gads_get_asset_group first.
- Already-removed signal -> idempotent success.
- Removing all search themes leaves audience signals only -> allowed but warn it may reduce steering.
- Audience signals are NOT touched by this tool (use gads_add_audience_signal counterpart).
- validate_only=true removes nothing; preview TTL expiry -> re-preview.