Skip to main content
Glama

Rewrite One Sentence Across A Campaign’s Unsent Copy

li_bulk_edit_steps
Destructive

Find an exact sentence in a campaign's UNSENT message steps and replace it, across every contact in one call.

A strategy's text is snapshotted PER PROSPECT at import, so a retired line exists once per person; use this for the SAME sentence campaign-wide, li_edit_step for per-person corrections.

⚠️ EXACT SUBSTRING, NEVER A REGEX or a pattern of any kind. $& and $1 in the replacement are literal characters. That is a safety property, not a simplification: there is no prior text stored anywhere, so a pattern typed against hundreds of live queues could not be undone.

⚠️ dryRun DEFAULTS TO TRUE. The first call previews: it reports how many steps match, what each would become, and how many CONTACTS hold no match at all. Pass dryRun=false to write.

⚠️ READ contactsUnmatched — it is the field that tells you your find-string was wrong. "191 changed, 23 people do not have that sentence" is a completely different fact from "done", and only that number says which. truncated means the cap stopped the scan, so the sweep is PARTIAL: run it again, or raise limit.

Every write goes through the same per-step guards as li_edit_step, so a step that sends between the preview and the write is refused rather than overwritten and lands in refused. Nothing is rescheduled — only the words change.

Input Schema

NameRequiredDescriptionDefault
findYesThe exact text to find, matched as a plain substring. An empty string is refused — it matches every step.
kindNoNarrow to ONE step of the sequence (e.g. followup_1). Omitted sweeps all of them.
limitNoHow many unsent steps to scan (max 500). The reply says `truncated` when the cap stopped it, so a partial sweep never reads as a complete one.
dryRunNoDEFAULTS TO TRUE — preview only, nothing written. Pass false to apply the rewrite.
replaceYesWhat to put in its place, inserted literally. Pass "" to delete the text.
campaignIdYesThe campaign whose unsent copy to sweep — from li_list_campaigns.
afterStepIdNoContinue a capped sweep from here — pass the `resumeAfterStepId` the previous reply gave you. Without it a second call re-reads the SAME window, and because the first run already replaced those lines they come back as `contactsUnmatched` — the field that means your find-string was wrong. So "run it again" needs this, or it reports the opposite of what happened. 1,630 steps against a cap of 500 is three calls.

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 declare destructiveHint=true but say nothing about mechanics; the description fills that gap richly: substring-only matching with no undo because no prior text is stored, dryRun defaulting to true, per-step guards that refuse steps mid-send rather than overwrite, and no rescheduling. This is exactly the extra context annotations cannot carry.

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?

Front-loaded with the core action, then warnings in descending priority. Every warning maps to a real failure mode (regex assumptions, accidental writes, misreading contactsUnmatched, partial sweeps), so the length is justified, though the emoji-prefixed callouts make it denser than strictly necessary.

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?

With no output schema, the description takes on return-value explanation and does it well, naming contactsUnmatched, truncated, refused, and resumeAfterStepId and what each means. For a destructive 7-parameter bulk mutation, nothing an agent needs to call 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 description coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: the afterStepId re-run pitfall (re-reading the same window makes replaced lines surface as contactsUnmatched), the semantics of truncated vs a complete sweep, and that find/replace are literal. That materially improves correct invocation.

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?

States a specific verb and resource: find an exact sentence across a campaign's UNSENT steps and replace it, campaign-wide in one call. It explicitly distinguishes itself from the sibling li_edit_step (per-person corrections), so an agent can route correctly without opening either schema.

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?

Gives an explicit when-to-use rule (the SAME sentence across every prospect) and names the alternative (li_edit_step) with the condition that selects it. It also covers the operational follow-ups: dryRun must be passed false to write, and afterStepId is required to continue a capped sweep.

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