Skip to main content
Glama

Search Replace Execute

search_replace_execute
Destructive

Apply approved site-wide search-and-replace changes to all matching content, permanently updating pages and optionally re-publishing them.

Instructions

Execute a site-wide search-and-replace across all content. Modifies every matching page permanently.

MANDATORY workflow:

  1. Run search_replace_preview and show the user which pages will be affected.

  2. Get explicit user confirmation before executing.

  3. Run search_replace_execute with a clear version_comment.

Set auto_republish: true to immediately re-publish all previously-published pages after updating them, collapsing the execute + publish_multiple flow into one call.

For targeted replacements, use scoped_search_replace_execute instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairsNoArray of {search, replace, regex} pairs for bulk mode. Applies all replacements in a single pass per page.
regexNoIf true, treat search as regex (single-pair mode)
searchNoText to search for (single-pair mode)
replaceNoText to replace with (single-pair mode)
auto_republishNoIf true, re-publish updated pages immediately
version_commentNoComment for version history

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv7.3.4
    • changedInput schema / properties / auto_republish / description
      Previous value: -"If true, re-publish all previously-published pages immediately after updating them (saves a separate publish_multiple call)"New value: +"If true, re-publish updated pages immediately"
    • addedInput schema / properties / pairs
      Added value: +{
      +  "description": "Array of {search, replace, regex} pairs for bulk mode. Applies all replacements in a single pass per page.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "regex": {
      +        "description": "If true, treat search as a Go regular expression",
      +        "type": "boolean"
      +      },
      +      "replace": {
      +        "description": "Text to replace with,required",
      +        "type": "string"
      +      },
      +      "search": {
      +        "description": "Text to search for,required",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "search",
      +      "replace"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / regex / description
      Previous value: -"If true, treat search as a Go regular expression. Use $1, $2 for capture group references in replace."New value: +"If true, treat search as regex (single-pair mode)"
    • changedInput schema / properties / replace / description
      Previous value: -"Text to replace with,required"New value: +"Text to replace with (single-pair mode)"
    • changedInput schema / properties / search / description
      Previous value: -"Text to search for,required"New value: +"Text to search for (single-pair mode)"
    • changedInput schema / properties / version_comment / description
      Previous value: -"Comment for version history (defaults to 'Bulk search and replace')"New value: +"Comment for version history"
    • removedInput schema / required
      Removed value: -[
      -  "search",
      -  "replace"
      -]
  2. First observedv4.2.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, but the description adds substantive context beyond them: that all matching pages are changed permanently, the required preview/confirmation safety flow, and the side effect that auto_republish re-publishes previously-published pages. This is exactly the 'what gets destroyed' context the annotations alone don't convey.

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?

Front-loads the blast radius, then the mandatory workflow, then the parameter note, then the alternative. Every sentence earns its place and the numbered steps are easy to scan.

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?

No output schema exists, yet the description covers side effects, the safety workflow, the cross-tool relationship (preview/publish_multiple/scoped variant), and permanence. Nothing an agent needs to invoke this destructive tool 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; the description adds meaning by explaining that auto_republish collapses the execute + publish_multiple flow into one call, which is not stated in the schema. It does not, however, discuss the pairs array vs single-pair mode relationship in the body text.

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 precise verb+resource+scope ('Execute a site-wide search-and-replace across all content') and immediately clarifies the blast radius ('Modifies every matching page permanently'). It explicitly distinguishes itself from the scoped sibling, so an agent can route 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?

Provides an explicit mandatory workflow (preview, confirm, execute with version_comment) plus a named alternative for the other case ('For targeted replacements, use scoped_search_replace_execute instead'). It also tells the agent when to set auto_republish, i.e. when publish_multiple would otherwise be needed.

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

Deploy Server

Other Tools