Skip to main content
Glama

royal-mcp__wp_replace_block

Destructive

Replace the block at path with new block markup (one or more blocks). The way to change a block's settings when it stores its own markup. 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).
pathYesBlock path from wp_get_block_outline, e.g. "2" or "2.0.1" (counting from 0).
markupYesSerialized block markup, e.g. <!-- wp:paragraph --><p>Text</p><!-- /wp:paragraph -->. Copy existing markup from wp_get_post or wp_get_synced_pattern as a model.
site_idNoSite to run this tool on: 8ef2e52b-bd07-4671-a363-ebe8b480b65c (https://demo.royalplugins.com)
expected_nameNoOptional guard: the block name you expect at path (e.g. core/heading). Nothing changes if it differs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/idempotentHint annotations: it discloses the edit-lock check, refusal of edits WordPress would strip for the account, revision saving, an undo token return, and the Royally human-approval gate where nothing changes until a person approves. That is unusually rich behavioral context for a mutation tool.

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 behavioral and approval details. Dense but mostly earns its place; the site-id parenthetical is mild noise reducible against the schema.

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 destructive mutation with no output schema, the description covers safety checks, revision/undo behavior, and the approval workflow — everything an agent needs to invoke it and set expectations about deferred effects.

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 id, path, markup, site_id and expected_name are all fully documented in the schema. The description adds only a general hint that markup concerns block settings, so baseline 3 is appropriate.

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 (replace) and resource (block at path with new markup), and adds 'The way to change a block's settings when it stores its own markup', which cleanly distinguishes it from the attribute-editing sibling wp_update_block_attributes. An agent can route correctly without opening either schema.

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?

Provides a clear selection condition — use this when a block stores its own markup rather than exposing settings as attributes. It implies the boundary with wp_update_block_attributes but does not name that sibling explicitly or state exclusions outright.

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