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, read-after-write verification and an undo token that puts the earlier content back (refused with edited_since_write if the post changed since, unless forced; none for a custom_css post or very large content). Set dry_run=true to preview the match count without writing; set expected_count to abort unless exactly that many matches exist. A custom_css post needs what wp_update_custom_css needs; refusal codes insufficient_caps, unfiltered_html_required, theme_writes_off. (site: demo.royalplugins.com) Through Royally: waits for a person to approve it in Royally; nothing on the site changes until then.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>",
      "find": "<find>",
      "replace": "<replace>"
    },
    "name": "royal-mcp__wp_replace_in_post"
  }
}

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. Added
  2. Removed
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only flag destructive/non-idempotent; the description adds the real behavioral detail: all occurrences replaced, case-sensitive literal with no regex, response carries occurrence count plus read-after-write verification, and an undo token that restores prior content with an edited_since_write refusal unless forced. It further discloses that undo is unavailable for custom_css posts or very large content, lists custom_css refusal codes, and notes approval-gated execution through Royally.

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 purpose and the alternative it replaces, and every clause carries information. The parenthetical about undo refusals, custom_css requirements and refusal codes makes the second half dense and run-on, but nothing is truly wasteful.

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 explains what the response returns (occurrence count, read-after-write verification, undo token) and enumerates failure modes. For a destructive, approval-gated edit tool, an agent has enough to call it safely and interpret the result without further discovery.

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 coverage is 83%, so most parameters are already documented; the description still adds semantic weight by framing expected_count as an exact-match abort guard and dry_run as a read-only preview of the match count, and by noting replace with an empty string deletes the match. It doesn't add anything beyond the schema for id or site_id.

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: literal find/replace inside a post's content without resending the body. It explicitly distinguishes itself from wp_update_post's full-content replacement and from the block/page variants by scoping to post content of any post type.

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 when-to-use ('surgical edits to large posts, page-builder content, embedded base64') and a named alternative it beats (wp_update_post). It also states when to use the guard modes: dry_run=true to preview counts, expected_count to abort on a count mismatch.

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