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

TableJSON Schema
NameRequiredDescriptionDefault
siteYes
expectNoHow many matches you expect
searchYes
confirmNoLeave unset to preview the matches. Set true only after the user has agreed to the exact replacement.
post_idYes
replaceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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 destructiveHint=true, readOnlyHint=false and idempotentHint=false, but the description adds a genuinely non-obvious behavioral trait: the call is rejected unless the observed match count equals `expect`, which is a safety guard not expressed anywhere in the structured data. It also scopes the blast radius ('changes only what you name'), though it doesn't mention revision/rollback behavior.

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, zero filler, front-loaded with the core action, then the sibling comparison, then the failure mode. Every sentence earns its place.

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, non-idempotent mutation with six parameters and no output schema, the description covers the action, the alternative, and the guard condition. It omits permission requirements and whether replacement is reversible, which are the remaining gaps for an agent to call this confidently.

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 only 33% (only `expect` and `confirm` are documented), so the description would need to carry more weight. It does explain `expect` behaviorally (mismatch causes refusal), but says nothing about `search`, `replace`, `post_id`, or `site`. Baseline 3 reflects partial compensation for a real coverage gap.

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 plus a tightly scoped resource ('replace an exact string inside one post's content'), which is materially narrower than the sibling wp_write_post and is explicitly contrasted against it ('Prefer this over rewriting a whole page'). An agent can distinguish this from wp_write_post and wp_get_post without opening a 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?

Gives a clear selection rule against the obvious alternative (wp_write_post) and warns that the call is refused on a match-count mismatch, which tells the agent to set `expect` deliberately. It stops short of stating prerequisites (permissions, preview-first workflow) beyond what the `confirm` schema field implies.

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.