Skip to main content
Glama

royal-mcp__wp_replace_text_in_blocks

Destructive

Find and replace literal text inside the blocks of a post (all blocks, or the block at path and its inner blocks). Text is replaced in each block's markup and attributes together so blocks stay valid; the replacement goes in as text (HTML characters are encoded), and block comments are never touched; to change markup use wp_replace_block. Case-sensitive, no regex. dry_run reports matches per block without writing; expected_count aborts unless exactly that many matches exist. Checks the edit lock, refuses changes WordPress would strip for your account, saves a revision and returns an undo token. (site: demo.royalplugins.com) Through Royally: waits for a person to approve it in Royally; nothing on the site changes until then.

Input Schema

NameRequiredDescriptionDefault
idYesPost ID (any post type that stores block content).
findYes
pathNoOptional: only this block and its inner blocks.
dry_runNo
replaceYesReplacement text; empty string deletes the match.
site_idNoSite to run this tool on: 8ef2e52b-bd07-4671-a363-ebe8b480b65c (https://demo.royalplugins.com)
expected_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing preconditions and side effects: it checks the edit lock, refuses changes WordPress would strip for the account, saves a revision, returns an undo token, and requires human approval in Royally before anything changes. The encoding behavior and that block comments are never touched are also non-obvious traits an agent must know.

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 core operation and packs the constraints into dense semicolon-separated clauses with no filler. The final single sentence is long and stacks several distinct behaviors (lock check, stripping refusal, revision, undo token, approval), which is harder to scan than splitting it would be.

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 7-parameter destructive write with no output schema, the description covers everything needed: matching rules, scope, encoding, safety preconditions, dry-run/expected-count safeguards, revision plus undo token, and the asynchronous human-approval gate. Nothing material about calling it correctly is missing.

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

Parameters5/5

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

Schema coverage is only 57% (find and expected_count have no schema descriptions), but the prose compensates: find is literal and case-sensitive with no regex, replace is inserted as encoded text and an empty string deletes the match, path limits to a block and its inner blocks, and dry_run/expected_count semantics are spelled out. The site target is also named in the text.

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 and resource ('find and replace literal text inside the blocks of a post') and scopes it precisely to all blocks or a path subtree. It explicitly routes markup edits to wp_replace_block, but does not distinguish itself from the closely related wp_replace_in_post and wp_replace_in_page siblings, which an agent could easily confuse it with.

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?

Gives clear use conditions: literal text only, case-sensitive, no regex, and 'to change markup use wp_replace_block' names the alternative for a different intent. It also explains when to reach for dry_run (report only) versus expected_count (abort unless exact match count), though it lacks explicit guidance on when to prefer it over wp_replace_in_post/wp_replace_in_page.

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