Meta: Update Ad Set Targeting
meta_update_adset_targetingChange 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
| Name | Required | Description | Default |
|---|---|---|---|
| cities | No | The 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_max | No | Oldest age to reach, 13 to 65. 65 means 65 and over. | |
| age_min | No | Youngest age to reach, 13 to 65. | |
| genders | No | Who to reach: ["men"], ["women"], or ["all"] for everyone. Omit to leave it alone. | |
| regions | No | The exact regions the ad set should target, as keys from meta_find_locations. | |
| adset_id | Yes | Ad set whose targeting to change. | |
| counties | No | The exact counties (Meta type medium_geo_area, e.g. a US county) the ad set should target, as keys from meta_find_locations. | |
| countries | No | The exact countries the ad set should target, as two-letter ISO codes, e.g. ["AU", "CA", "NZ"]. Replaces the current country list. | |
| dsa_payor | No | EU only: the person or organisation paying for the ads. Defaults to dsa_beneficiary. | |
| add_cities | No | City keys to start targeting. | |
| add_regions | No | Region keys to start targeting. | |
| add_counties | No | County keys to start targeting. | |
| radius_miles | No | How 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_id | No | Meta 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_countries | No | Countries to start targeting, as two-letter ISO codes. | |
| remove_cities | No | City keys to stop targeting. | |
| remove_regions | No | Region keys to stop targeting. | |
| dsa_beneficiary | No | EU 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_counties | No | County keys to stop targeting. | |
| remove_countries | No | Countries to stop targeting, as two-letter ISO codes. | |
| expand_to_interested_in_location | No | Only 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
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name of the ad set. | |
| added | Yes | How many locations were added. | |
| ageMax | No | Oldest age the ad set now reaches. | |
| ageMin | No | Youngest age the ad set now reaches. | |
| cities | Yes | Cities the ad set now targets. | |
| adSetId | Yes | Ad set that was updated. | |
| genders | Yes | Who the ad set now reaches. Empty means everyone. | |
| regions | Yes | Regions the ad set now targets. | |
| removed | Yes | How many locations were removed. | |
| skipped | Yes | What the call did not have to do: a location already targeted, one already gone. | |
| countries | Yes | Countries the ad set now targets, as ISO codes. | |
| excludedCountries | Yes | Countries the ad set excludes. This tool never changes them. | |
| expandToInterestedInLocation | Yes | Whether Meta may also reach people interested in the targeted cities and regions. Null when Meta does not report the setting. |