google_ads_asset_group_images_replace
Replace a Performance Max asset group image or logo in one atomic mutation, preventing minimum-asset errors. Use an existing image asset or upload a local file; dimensions are checked before change.
Instructions
Swaps one image or logo of a Performance Max asset group for another. Mutating. Use this whichever situation you are in: pass new_asset_id when the account already holds the image (google_ads_image_assets_list finds one), or new_image_path to upload a local file first — exactly one of the two, and mureo handles the difference. The replacement is linked under the same field_type and the old link is removed in ONE atomic GoogleAdsService.mutate, so the asset group's asset count for that field type never dips below the Performance Max minimum (a removal issued on its own is refused with AssetGroupError.NOT_ENOUGH_MARKETING_IMAGE_ASSET or its square / logo twin). Neither Asset is deleted; only the old link to this asset group is. Google enforces a shape per slot — MARKETING_IMAGE 1.91:1 (min 600x314), SQUARE_MARKETING_IMAGE 1:1 (min 300x300), PORTRAIT_MARKETING_IMAGE 4:5 (min 480x600), LOGO 1:1 (min 128x128), LANDSCAPE_LOGO 4:1 (min 512x128) — and mureo checks it before uploading or linking anything, then refuses with the rule spelled out. It never crops or resizes. Returns {asset_group_id, field_type, added: {asset_id, asset_name, width_pixels, height_pixels, source ('existing_asset' | 'uploaded'), asset_group_asset}, removed: {asset_id, asset_name, url, asset_group_asset}, note}. Not automatically reversible — to swap back, call this tool again with the old asset_id; record before-state with mureo_state_action_log_append if you may need to roll back. Call google_ads_asset_group_assets_list first to get old_asset_id. For headlines and descriptions use google_ads_asset_group_assets_replace instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field_type | Yes | Which image slot to swap. Must match the field_type the old asset is linked under — the same image can be linked as more than one field type, and each has its own required aspect ratio. | |
| customer_id | No | Google Ads customer ID as a 10-digit string without dashes (e.g. '1234567890'). Optional — falls back to GOOGLE_ADS_CUSTOMER_ID / GOOGLE_ADS_LOGIN_CUSTOMER_ID from the configured credentials when omitted. | |
| new_asset_id | No | An image asset the account already holds, from google_ads_image_assets_list or from another asset group's entry. Rejected if it is not an image asset, if its dimensions do not fit this field_type, or if it is already linked to this asset group under this field_type (Google Ads refuses a duplicate link). Supply this OR new_image_path, never both. | |
| old_asset_id | Yes | asset_id of the entry being replaced, from google_ads_asset_group_assets_list. Rejected before any write if it is not linked to this asset group under this field_type. | |
| asset_group_id | Yes | Asset group whose image is being changed, as reported by google_ads_asset_group_assets_list. | |
| new_image_name | No | Asset name for the uploaded image. Only used with new_image_path; defaults to the file name. | |
| new_image_path | No | Local path to an image to upload and link (jpg/jpeg/png/gif, max 5MB). Its dimensions are checked against this field_type BEFORE the upload, so a wrongly proportioned file costs no API call. Supply this OR new_asset_id, never both. |