Skip to content

update_campaign: geo_target_ids array serialisation fails + no support for exclusions #46

Description

@andi-christ

Bug 1 — Array parameter received as string

Calling update_campaign with geo_target_ids always fails with:

1 validation error for call[update_campaign]
geo_target_ids
  Input should be a valid list [type=list_type, input_value='["2840"]', input_type=str]

The MCP bridge serialises the list to a string before the tool receives it, regardless of whether values are strings or integers. The tool never receives a Python list, making geo_target_ids completely unusable.

Bug 2 — No support for location exclusions

The Google Ads API distinguishes campaign_criterion.negative: false (inclusions) from campaign_criterion.negative: true (exclusions). update_campaign has no geo_exclusion_ids parameter. Even if Bug 1 were fixed, calling the tool on a campaign with existing exclusions would silently wipe them — a potentially expensive mistake.

Suggested fixes

  1. Deserialise list parameters with json.loads() when the schema expects a list but receives a string.
  2. Add a geo_exclusion_ids parameter (or rename to geo_inclusion_ids / geo_exclusion_ids pair).
  3. When geo_target_ids is called on a campaign with existing exclusions, either preserve them or warn explicitly.

Reproduction

Any call to update_campaign with geo_target_ids set to a list triggers Bug 1. Bug 2 is visible by querying campaign_criterion with the negative field — real campaigns commonly have dozens of exclusions alongside a single inclusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions