Skip to main content
Glama

google_ads_asset_group_images_replace

Swap a Performance Max asset group image or logo atomically: link a new asset and remove the old link in one mutate, so slot minimums are never breached and no asset is deleted.

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

NameRequiredDescriptionDefault
reasonNoWhy this change is being made: one or two sentences naming the evidence and the expected effect. Stored in the journal and on the action_log entry this call produces, for the operator and the next session.
approvalNoExternal approval this change carries out (recorded and shown, never verified)
expectedNoExpected effects [{metric, direction, target?, horizon_days?, primary?}], exactly one primary:true when several; metric cpa/cpc/cpl/cpm/conversions/cvr/ctr/roas/cost/spend/clicks/impressions; direction up/down/hold.
field_typeYesWhich 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_idNoGoogle 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.
decision_idNoA proposed decision this change carries out.
new_asset_idNoAn 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_idYesasset_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_idYesAsset group whose image is being changed, as reported by google_ads_asset_group_assets_list.
new_image_nameNoAsset name for the uploaded image. Only used with new_image_path; defaults to the file name.
new_image_pathNoLocal 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.33.0
    • changedInput schema / properties / expected / description
      Previous value: -"Expected effects [{metric, direction, target?, horizon_days?}]; metric cpa/cpc/cpl/cpm/conversions/cvr/ctr/roas/cost/spend/clicks/impressions; direction up/down/hold."New value: +"Expected effects [{metric, direction, target?, horizon_days?, primary?}], exactly one primary:true when several; metric cpa/cpc/cpl/cpm/conversions/cvr/ctr/roas/cost/spend/clicks/impressions; direction up/down/hold."
  2. Changed1 schema field changedv0.28.0
    • addedInput schema / properties / approval
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "External approval this change carries out (recorded and shown, never verified)",
      +  "properties": {
      +    "approved_at": {
      +      "maxLength": 64,
      +      "type": "string"
      +    },
      +    "approved_by": {
      +      "maxLength": 80,
      +      "type": "string"
      +    },
      +    "reference": {
      +      "maxLength": 128,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "reference",
      +    "approved_by",
      +    "approved_at"
      +  ],
      +  "type": "object"
      +}
  3. Changed2 schema fields changedv0.26.0
    • addedInput schema / properties / decision_id
      Added value: +{
      +  "description": "A proposed decision this change carries out.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / expected
      Added value: +{
      +  "description": "Expected effects [{metric, direction, target?, horizon_days?}]; metric cpa/cpc/cpl/cpm/conversions/cvr/ctr/roas/cost/spend/clicks/impressions; direction up/down/hold.",
      +  "maxItems": 12,
      +  "type": "array"
      +}
  4. Changed1 schema field changedv0.20.0
    • addedInput schema / properties / reason
      Added value: +{
      +  "description": "Why this change is being made: one or two sentences naming the evidence and the expected effect. Stored in the journal and on the action_log entry this call produces, for the operator and the next session.",
      +  "maxLength": 500,
      +  "type": "string"
      +}
  5. Addedv0.13.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does: it discloses the single atomic mutate, why atomicity matters (the specific AssetGroupError codes a standalone removal triggers), that Assets are not deleted but links are, that it never crops/resizes, and that it is not automatically reversible. This is behavior beyond what any structured field provides.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the verb and mutation warning, then usage, then behavior, then return shape. Dense but well compartmentalized. The long parenthetical aspect-ratio list and a full enumeration of the return object are more verbose than strictly necessary given the schema already carries field-level detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation with nested approval/expected objects and no output schema, the definition covers preconditions, validation failures, atomicity guarantees, irreversibility/rollback path, and the return payload shape. An agent has everything needed to call it correctly or refuse to.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so baseline is 3; the description adds real value by spelling out the either/or mode of new_asset_id vs new_image_path and that the tool 'handles the difference', plus linking field_type to the per-slot shape rules. It does not cover the journaling metadata params (reason, approval, expected, decision_id), which the schema already documents well.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource+scope: swapping one image/logo of a Performance Max asset group for another. It explicitly names the sibling that handles headlines/descriptions (google_ads_asset_group_assets_replace), so the agent can route without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit mutually exclusive paths ('pass new_asset_id when the account already holds the image ... or new_image_path to upload a local file first — exactly one of the two'), names prerequisite tools (google_ads_asset_group_assets_list, google_ads_image_assets_list) and the exclusion for text assets. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools