Skip to main content
Glama
tecspda

listmonk-mcp-ts

regex_replace_in_campaign_body

Destructive

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.

Input Schema

NameRequiredDescriptionDefault
patternYesJavaScript regular expression source without slashes, applied globally, e.g. https://old\.example\.com
replaceYesReplacement text; may use capture groups such as $1
campaign_idYesCampaign ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • changedInput schema / properties / pattern / description
      Previous value: -"Regex pattern"New value: +"JavaScript regular expression source without slashes, applied globally, e.g. https://old\\.example\\.com"
    • changedInput schema / properties / replace / description
      Previous value: -"Replacement pattern"New value: +"Replacement text; may use capture groups such as $1"
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and readOnlyHint=false; the description adds real value on top by clarifying that the replacement is global, that the campaign is persisted, that a no-match case is a safe no-op, and that an invalid pattern errors out. It stops short of saying the saved mutation is irreversible / has no undo, which is the main remaining behavioral gap for a destructive write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences, front-loaded with the action and the persistence side effect, followed by outcome reporting, error behavior, and the alternative routing. No filler.

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 3-parameter mutation tool with no output schema, the description covers the write side effect, the return signal (count of matches replaced), the zero-match no-op, and the invalid-pattern error path — everything an agent needs to call it and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents pattern (JS source without slashes, global), replace ($1 capture groups) and campaign_id. The description adds only the implicit confirmation that matching is global, which the schema states anyway — baseline 3 is appropriate.

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 (replace all matches of a JavaScript regex) applied to a specific resource (a campaign's body) and explicitly notes that the campaign is saved. It also names the sibling it is not (replace_in_campaign_body) for plain-text substitution, so an agent can distinguish it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes plain-text substitutions to replace_in_campaign_body, which is a clear when-to-use signal. It does not mention the other related sibling batch_replace_in_campaign_body, nor state any exclusion such as when a single-campaign regex edit is the wrong choice.

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