Skip to main content
Glama

Google Ads & Meta Ads

Meta: Update Ad Set Targeting

meta_update_adset_targeting
DestructiveIdempotent

Change where a Meta ad set delivers and who it reaches: target or drop countries, regions, cities and counties, set the radius around a city, and set the age range and gender. Read the current targeting first with meta_list_campaigns and include_targeting, and resolve region, city and county keys with meta_find_locations — countries are plain two-letter ISO codes. Each geography can be given either as an exact list (countries) or as changes to the current one (add_countries, remove_countries), not both. Everything the call does not name is left exactly as it is, including interests, custom audiences, placements and excluded locations. An edit that would leave the ad set with no location at all is refused, and so is a place inside another place the ad set also targets (a city beside its country or region): Meta rejects overlapping locations, so target the larger area or the smaller one. Giving an exact country, region, city or county list also clears any pinned map locations, which Meta will not accept alongside an overlapping city. For ad sets that target cities or regions, expand_to_interested_in_location turns Meta's "Reach more people likely to respond" on or off: on, ads may also reach people elsewhere who are interested in those places. When Meta asks for an EU advertiser name (an ad set reaching an EU country in an ad account with no default), ask the user and pass dsa_beneficiary and dsa_payor with the same change. Targeting changes restart the ad set's learning phase, so delivery and cost per result are unstable for a day or two afterwards.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "adset_id": "<adset_id>"
    },
    "name": "meta_update_adset_targeting"
  }
}

Input Schema

NameRequiredDescriptionDefault
citiesNoThe exact cities the ad set should target, as keys from meta_find_locations. An exact list also clears any pinned map locations the ad set targets, since Meta refuses a city and an overlapping pin together.
age_maxNoOldest age to reach, 13 to 65. 65 means 65 and over.
age_minNoYoungest age to reach, 13 to 65.
gendersNoWho to reach: ["men"], ["women"], or ["all"] for everyone. Omit to leave it alone.
regionsNoThe exact regions the ad set should target, as keys from meta_find_locations.
adset_idYesAd set whose targeting to change.
countiesNoThe exact counties (Meta type medium_geo_area, e.g. a US county) the ad set should target, as keys from meta_find_locations.
countriesNoThe exact countries the ad set should target, as two-letter ISO codes, e.g. ["AU", "CA", "NZ"]. Replaces the current country list.
dsa_payorNoEU only: the person or organisation paying for the ads. Defaults to dsa_beneficiary.
add_citiesNoCity keys to start targeting.
add_regionsNoRegion keys to start targeting.
add_countiesNoCounty keys to start targeting.
radius_milesNoHow far around each targeted city ads may show, 10 to 50 miles — Meta refuses anything tighter than 10. Applies to every city the ad set targets; countries and regions have no radius.
ad_account_idNoMeta ad account to change: act_ id or exact account name. Required when you have several ad accounts — the stored default is never used for a change then.
add_countriesNoCountries to start targeting, as two-letter ISO codes.
remove_citiesNoCity keys to stop targeting.
remove_regionsNoRegion keys to stop targeting.
dsa_beneficiaryNoEU only: the person or organisation the ads promote, shown to EU viewers under the Digital Services Act. Meta requires it when the ad set reaches an EU country and the ad account has no default advertiser. Ask the user for the exact name; never guess it.
remove_countiesNoCounty keys to stop targeting.
remove_countriesNoCountries to stop targeting, as two-letter ISO codes.
expand_to_interested_in_locationNoOnly for ad sets that target cities or regions. true lets Meta also reach people outside them who are interested in those places; false keeps delivery to people in them. Omit to leave the current setting alone.

Output Schema

NameRequiredDescriptionDefault
nameNoName of the ad set.
addedYesHow many locations were added.
ageMaxNoOldest age the ad set now reaches.
ageMinNoYoungest age the ad set now reaches.
citiesYesCities the ad set now targets.
adSetIdYesAd set that was updated.
gendersYesWho the ad set now reaches. Empty means everyone.
regionsYesRegions the ad set now targets.
removedYesHow many locations were removed.
skippedYesWhat the call did not have to do: a location already targeted, one already gone.
countriesYesCountries the ad set now targets, as ISO codes.
excludedCountriesYesCountries the ad set excludes. This tool never changes them.
expandToInterestedInLocationYesWhether Meta may also reach people interested in the targeted cities and regions. Null when Meta does not report the setting.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructive=true, idempotent=true and openWorld=true, yet the description still adds substantial context beyond them: unnamed fields (interests, custom audiences, placements, excluded locations) are preserved, an edit leaving zero locations is refused, overlapping locations are rejected, exact geo lists clear pinned map pins, and targeting edits restart the learning phase. These are non-obvious side effects and refusals an agent needs to plan around.

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?

The purpose is front-loaded in the first sentence and every subsequent sentence carries substantive rules rather than filler. It is, however, one dense run-on paragraph for a 21-parameter tool; splitting the refusal/overlap/DSA rules into distinct sentences or bullets would cost nothing and aid scanning.

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 a 21-parameter destructive mutation with an output schema, the description covers the prerequisites (read-first, key resolution, DSA name prompting), the failure modes (no-location refusal, overlapping locations, pinned-map conflict), and the post-call consequences (learning phase reset). Nothing an agent needs to invoke it safely is missing.

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 100%, so the baseline is 3, but the description adds real meaning the schema does not: the mutual exclusivity between exact lists and add_/remove_ deltas, the note that radius_miles applies to every targeted city, and the DSA beneficiary/payor requirement trigger. It does not add much on age_min/age_max or genders beyond what the schema already says.

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?

The opening sentence gives a specific verb and resource ("Change where a Meta ad set delivers and who it reaches") and immediately enumerates the exact knobs: countries, regions, cities, counties, radius, age range, gender. This is clearly distinct from sibling meta_update_adset_bidding (budget/bid) and meta_get_adset (read).

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?

Explicit prerequisites and alternatives are named: read current targeting first with meta_list_campaigns plus include_targeting, resolve geo keys with meta_find_locations, and treat countries as plain ISO codes. It also states a hard usage rule — exact list versus add_/remove_ deltas, never both — which an agent could not infer from the schema alone.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources