Skip to main content
Glama

Search Replace Preview

search_replace_preview
Read-only

Preview site-wide search-and-replace changes before execution, showing affected pages, total matches, and per-page field breakdown without modifying live content.

Instructions

Preview a site-wide search-and-replace without making any changes. ALWAYS run this before search_replace_execute.

Returns: affected page count, total match count, and per-page field breakdown. Only live pages are searched; fork copies are never matched or rewritten. For targeted replacements (a folder, template, or category), use scoped_search_replace_preview instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairsNoArray of {search, replace, regex} pairs for bulk mode. Scans each page once, applying all pairs in order. Much faster than calling preview multiple times.
regexNoIf true, treat search as regex (single-pair mode)
searchNoText to search for (single-pair mode)
replaceNoText to replace with (single-pair mode)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv7.3.4
    • addedInput schema / properties / pairs
      Added value: +{
      +  "description": "Array of {search, replace, regex} pairs for bulk mode. Scans each page once, applying all pairs in order. Much faster than calling preview multiple times.",
      +  "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)"
    • removedInput schema / required
      Removed value: -[
      -  "search",
      -  "replace"
      -]
  2. First observedv4.2.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the 'no changes' guarantee is partly redundant, but the description adds real behavioral detail: only live pages are searched and fork copies are never matched or rewritten. It does not cover the batch-vs-single-pair execution cost beyond what the schema says.

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?

Short, front-loaded: action and safety first, mandate second, return shape third, sibling routing last. Every sentence carries distinct information with 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?

With no output schema, the description compensates by naming the return shape (affected page count, total match count, per-page field breakdown). Combined with the safety and scoping notes, it is complete enough for an agent to call correctly.

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 coverage is 100%, so all four parameters (pairs, regex, search, replace, and the nested regex flag) are already documented in the schema. The description adds nothing about parameter syntax or precedence, so baseline 3 applies.

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+resource ('Preview a site-wide search-and-replace') and immediately distinguishes scope ('site-wide') from the scoped variant. An agent can tell it apart from search_replace_execute and scoped_search_replace_preview without opening any 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?

Explicitly states 'ALWAYS run this before search_replace_execute' and names the alternative for targeted replacements with the selecting condition (folder, template, category). Both when-to-use and when-to-use-something-else are covered.

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