Find and replace text in ads (adsap_replace_ad_text)
Platform: Meta · Read or write: Write · Plan: Early Access · Consumes a task: Yes, one per ad changed · Preview supported: Yes
What it does
Changes the same text in many Meta ads at once, for example an old offer or a number that changed. It works on the ads of one ad set or one campaign. A first call finds the ads and returns a preview of every change, and nothing is changed until you confirm. Then the assistant applies the preview, and every ad gets the same checks as a single edit.
When to use it
- Use it when the same words appear in several ads and must change everywhere: “replace 1,900+ with 2,000+ in all my ads”.
- The text is found with the same rule as
adsap_list_ads: upper and lower case and extra spaces do not matter, emojis, punctuation and digits must match exactly. Every occurrence is replaced by your new text exactly as you typed it. - Primary texts, headlines and descriptions are covered, every variation included. Pass
fieldsto change only some of them. - The preview lists every ad with its text before and after. It also lists the ads where another setting would change (
held), and the texts Adsap cannot change: carousel cards, Flexible ads, catalog ads and ads made from an existing post (cannot_change). - To apply, the assistant sends the
preview_idwithdry_runset tofalse, within 30 minutes. Each call changes ads for about 35 seconds; whenmeta.remainingis above 0, it calls again until every ad is done. - An ad that someone changed after the preview is skipped, never overwritten. To change a link, a button or the media, or one ad in a custom way, use
adsap_replace_ad_creative.
Worked example
You ask
“In my BF26 ad set, replace 1,900+ with 2,000+ in every ad. Show me first.”
The assistant calls adsap_replace_ad_text
{
"ad_account_id": "act_1234567890",
"ad_set_id": "120210000000001",
"find": "1,900+",
"replace_with": "2,000+",
"dry_run": true
}Adsap returns
The field names are the ones Adsap returns. The values are examples.
{
"ok": true,
"dry_run": true,
"preview_id": "7f3c2a9e-1b4d-4c8e-9a51-2d6f0b8e4c17",
"data": {
"ads": [
{
"ad_id": "120210000000010",
"name": "BF26 video 1",
"effective_status": "ACTIVE",
"changes": [
{
"field": "primary_text",
"variant": 2,
"of": 5,
"before": "Loved by many. 1,900+ reviews",
"after": "Loved by many. 2,000+ reviews"
}
]
}
],
"held": [],
"cannot_change": [
{
"ad_id": "120210000000011",
"name": "BF26 carousel",
"field": "headline",
"card": 2,
"text": "1,900+ happy customers",
"reason": "This text is on a carousel card. Adsap cannot change carousel card texts."
}
]
},
"meta": {
"ads_to_change": 1,
"held": 0,
"active_ads": 1,
"searched_count": 12,
"more_to_preview": false,
"expires_in_minutes": 30
}
}How to read it
data.ads lists each ad that would change, with every text before and after; variant and of say which of the ad’s texts of that kind it is. held lists ads where another setting would also change: they are left out unless you agree. cannot_change lists texts Adsap cannot reach, with the reason. meta.active_ads counts the running ads: each changed ad gets a new creative, which can restart its learning and reset the likes and comments it shows.
To apply, the assistant calls again with the same ad_account_id, dry_run set to false and the preview_id. The answer lists changed (with each new creative id), not_changed with the reason, and warnings when Meta reports a setting different from what Adsap sent. The full response also has a human_readable_summary sentence, left out here.
Parameters
Descriptions are shortened from the tool schema. Your assistant sees the full text.
| Name | Type | Required | Description |
|---|---|---|---|
ad_account_id | string | Yes | Ad account ID (act_xxx). Required in both steps. |
ad_set_id | string | No | Preview only: the ad set whose ads to search (numeric). Pass exactly one of ad_set_id or campaign_id. |
campaign_id | string | No | Preview only: the campaign whose ads to search, across its ad sets (numeric). Pass exactly one of ad_set_id or campaign_id. |
find | string | No | Preview only: the text to find. Upper and lower case and extra spaces are ignored; emojis, punctuation and digits must match exactly. |
replace_with | string | No | Preview only: the new text, used exactly as typed (case included). An empty string removes the text found. |
fields | array of one of primary_text, headline, description | No | Preview only: which texts to change. Default: all three (primary_text, headline, description). |
after | string | No | Preview only: meta.paging_after from a previous preview, to search the ads after the first 500. |
dry_run | boolean | No | Preview only: the request is validated and the resolved payload returned, nothing is created or changed. |
preview_id | string | No | Apply only: the preview_id returned by the preview. |
ad_ids | array of string | No | Apply only: change only these ads of the preview. Held ads are changed only when named here. |
Example prompts
- “Replace 1,900+ with 2,000+ in every ad of my BF26 ad set.”
- “In the Spring sale campaign, change ‘Free shipping’ to ‘Free delivery’ in the headlines only.”
- “Remove ‘Last chance!’ from the primary texts of this ad set. Show me the preview first.”
Notes
One task is counted for each ad changed. A preview covers up to 50 ads; when more ads contain the text, apply these and preview again. Matching texts are searched in up to 500 ads per call.
Related tools
adsap_create_ad: Create a Meta ad (image/video) in an ad set.adsap_duplicate_ad_set: Duplicate an existing Meta ad set into 1-10 copies, keeping ALL its ads (including ads with no delivery yet).adsap_get_ad: Read ONE ad in full, live from Meta: its creative content (primary texts, headlines, descriptions, CTA, destination link, URL parameters…adsap_get_ad_review_status: Check review and policy status of all active (optionally paused) ads in an account.adsap_get_ad_set: Read ONE ad set in full, live from Meta: complete targeting spec (geo incl. regions/cities, age, genders, custom audiences…adsap_get_ad_status: Check the current delivery, review, and effective status of a single Meta ad.adsap_list_ad_accounts: List Meta ad accounts the user manages.
Guide
Read Building the ads for the workflow around this tool, and the Tool reference for every tool.
The Meta Ads MCP server page shows how to connect Meta Ads to Claude, ChatGPT or Perplexity.