Skip to main content
Glama

royal-mcp__wp_replace_in_post

Destructive

Find/replace a literal string inside a post's content (any post type) without resending the full body. Use for surgical edits to large posts (page-builder content, embedded base64 payloads) where wp_update_post's full-content replacement is impractical. Case-sensitive literal match, no regex. All occurrences are replaced. Response includes occurrence count and read-after-write verification. Set dry_run=true to preview the match count without writing; set expected_count to abort unless exactly that many matches exist. (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
idYes
findYesLiteral text to find in post_content (case-sensitive, no regex).
dry_runNoReport the occurrence count without writing. Default false.
replaceYesLiteral replacement text. Empty string deletes the matched text.
site_idNoSite to run this tool on: 8ef2e52b-bd07-4671-a363-ebe8b480b65c (https://demo.royalplugins.com)
expected_countNoOptional guard: abort without writing unless the number of occurrences equals this value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Adds a lot beyond the annotations: all occurrences are replaced, case-sensitive literal-only matching, response includes an occurrence count plus read-after-write verification, and dry_run/expected_count act as safety gates. Most importantly it discloses that the call routes through Royally and blocks on human approval before anything changes — a critical trait the annotations do not convey. Slight deduction because it does not say whether the edit is reversible or what happens to revisions.

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-loaded with the core action before alternatives, semantics, guards, and the approval caveat — a sound ordering. It is dense and runs long in a single block, but essentially every sentence carries operational information.

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 mutation with no output schema, the definition covers the important ground: what gets modified (post_content), how matches are counted, the human-approval gate, and the verification response. Missing only secondary details such as revision/undo behavior and error conditions.

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?

With schema coverage at 83%, the description still adds real meaning: it clarifies that find is literal/case-sensitive with no regex, that all matches are replaced, and that dry_run previews counts and expected_count aborts on mismatch. The one opaque parameter is `id`, which the schema leaves bare and the description only implies is the post ID.

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+resource ('find/replace a literal string inside a post's content') with scope ('any post type') and explicitly distinguishes itself from wp_update_post's full-content replacement. It does not differentiate against the near-identical siblings wp_replace_in_page or wp_replace_text_in_blocks, which is the main remaining ambiguity.

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 a clear use case ('surgical edits to large posts — page-builder content, embedded base64 payloads') and names the alternative it beats (wp_update_post). Also explains when to use dry_run and expected_count. It lacks explicit 'do not use when' exclusions against the block-level or page-level replace siblings.

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