regex_replace_in_campaign_body
Replace all matches of a JavaScript regex in a campaign body and save it, returning the replacement count; invalid patterns return an error and zero matches change nothing.
Instructions
Replace all matches of a JavaScript regular expression in a campaign's body and save the campaign. Reports how many matches were replaced and changes nothing if there is no match. An invalid pattern returns an error. For plain text use replace_in_campaign_body.
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": {
"campaign_id": "<campaign_id>",
"pattern": "<pattern>",
"replace": "<replace>"
},
"name": "regex_replace_in_campaign_body"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | JavaScript regular expression source without slashes, applied globally, e.g. https://old\.example\.com | |
| replace | Yes | Replacement text; may use capture groups such as $1 | |
| campaign_id | Yes | Campaign ID |