Skip to main content
Glama

WordPress: Replace in post

wp_replace_in_post
Destructive

Replace an exact string inside one post's content. Prefer this over rewriting a whole page — it changes only what you name. The call is REFUSED if the number of matches is not what you expected, so pass expect honestly.

Input Schema

NameRequiredDescriptionDefault
siteYes
expectNoHow many matches you expect
searchYes
confirmNoLeave false to preview: nothing changes and the preview shows exactly what would happen. Set true only after the user has agreed to this exact change.
post_idYes
replaceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / confirm / default
      Added value: +false
    • changedInput schema / properties / confirm / description
      Previous value: -"Leave unset to preview the matches. Set true only after the user has agreed to the exact replacement."New value: +"Leave false to preview: nothing changes and the preview shows exactly what would happen. Set true only after the user has agreed to this exact change."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructive=true, idempotent=false, openWorld=true, so the safety profile is covered. The description adds real value beyond that with the refusal semantics (the call fails if match count differs from `expect`), which is behavior an agent must know to avoid surprising failures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, all load-bearing: the operation, the sibling preference, and the failure mode. The most important constraint (refusal on match mismatch) is given its own sentence.

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?

No output schema exists, yet the description covers the key failure mode and the preview path is covered by the confirm parameter's schema description. Minor gap: it doesn't say what a successful or preview response contains, but for a destructive mutation this is largely sufficient.

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 coverage is only 33% (expect and confirm documented); site, post_id, search, and replace are undocumented in the schema. The description partially compensates by explaining `expect` ("pass `expect` honestly"), but search/replace scoping and site handling remain unspecified, so it only meets the minimum bar.

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 scope (exact string inside one post's content), and explicitly differentiates from whole-page rewriting. An agent immediately knows this is a surgical edit, not a content rewrite.

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?

"Prefer this over rewriting a whole page — it changes only what you name" gives a clear selection criterion against the rewrite sibling (wp_write_post). It does not, however, give a when-not-to-use case or name the alternative tool explicitly.

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.