Skip to main content
Glama

Scoped Search Replace Execute

scoped_search_replace_execute
Destructive

Run a scoped search-and-replace across selected LightCMS pages by content ID, folder, template, or category, then optionally republish the updated live pages.

Instructions

Execute a search-and-replace limited to a subset of pages. ALWAYS run scoped_search_replace_preview first and show results to the user before executing.

Scope options (all optional):

  • content_ids, folder_path, template_name, category

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

Only live pages are changed: fork copies named in content_ids come back in "skipped" as {id, reason}.

Example: {"search": "old text", "replace": "new text", "folder_path": "/blog", "auto_republish": true, "version_comment": "Updated old references"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regexNoIf true, treat search as a Go regular expression. Use $1, $2 for capture group references in replace.
searchYesText to search for,required
replaceYesReplacement text (empty string to delete)
categoryNoLimit to pages in this category
content_idsNoLimit to specific content IDs
folder_pathNoLimit to pages whose URL starts with this path (e.g. /blog)
template_nameNoLimit to pages using this template name (e.g. 'Concept Page')
auto_republishNoIf true (execute only), re-publish all previously-published pages immediately after updating them (saves a separate publish_multiple call)
version_commentNoVersion comment for updated pages

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.2.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: only live pages are changed and fork copies named in content_ids are returned in a 'skipped' list as {id, reason}. It still omits whether the operation is reversible/rollbackable, but the added fork-skip semantics are meaningful.

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-loads the operation and the mandatory preview step, then uses a bullet list for scope options and closes with a concrete JSON example. The scope bullet list mostly duplicates the schema and could be trimmed, but overall it is well-structured and appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive bulk mutation, it covers the precondition (preview first), the scoping dimensions, live-vs-fork behavior, and the skipped-return shape. Auth/permission requirements and reversibility are not addressed, but with destructiveHint set and no output schema, the description is largely complete for correct invocation.

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 every parameter is documented in the schema itself (including the auto_republish publish_multiple collapsing detail and the regex capture-group syntax). The description's scope-option list and auto_republish note largely restate schema content, adding grouping but little new meaning. Baseline 3 is correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (execute), resource (search-and-replace) and scope (limited to a subset of pages), and names the preview sibling. The scope options are enumerated clearly. It does not distinguish itself from the sibling search_replace_execute (the unscoped variant), so an agent must infer that difference from the word 'scoped'.

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 precondition ('ALWAYS run scoped_search_replace_preview first and show results to the user before executing') and routes the agent to that alternative. It also explains when to enable auto_republish to collapse the execute + publish_multiple flow, which is actionable guidance rather than mere description.

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