Skip to main content
Glama

WordPress: replace exact text inside a theme option

wp_theme_option_replace
Destructive

Replace exact text inside a theme option, e.g. take one offer out of the business schema in _crb_header_script without removing the whole block. Exact count (expect, default 1), and the new text can't add markup (no < or >). Previews the text around it before and after; confirm to replace. The old value is backed up and the site cache cleared. Needs Bridge 1.7.2+ and an administrator's application password.

Input Schema

NameRequiredDescriptionDefault
keyYesThe _crb_* option, from wp_theme_options_get or wp_snippets_get
siteYes
expectNoHow many times search appears (default 1)
searchYesThe exact text, as listed
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.
replaceYesThe new text ("" removes it); no < or >

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

The description adds substantial behavior beyond the annotations: it previews surrounding text before and after, requires confirmation to actually replace, backs up the old value, clears the site cache, and enforces exact-count matching. These details make the destructive nature and safety workflow clear.

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?

The purpose is front-loaded, followed by only the constraints and safety behavior an agent needs. Every sentence contributes: exact-count matching, preview/confirm, backup/cache, and version/auth requirements.

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 tool with no output schema, the description covers the critical operational details: preview-before-change, confirmation, backup, cache clearing, count constraints, and auth prerequisites. Nothing essential is missing for an agent to invoke it safely.

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 high at 83%, so the schema already documents the key parameters. The description repeats most parameter details (expect default 1, no < or > in replacement, confirm-to-apply) rather than adding much meaning beyond the schema.

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?

The description states a precise verb and resource: replacing exact text inside a WordPress theme option. The example of removing one offer from _crb_header_script without removing the whole block makes the scope concrete and distinguishable from whole-option updates.

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?

It clearly explains the intended use case: surgical text replacement without deleting an entire block. It also states prerequisites (Bridge 1.7.2+ and an administrator application password), but it does not explicitly compare this tool to the sibling wp_theme_option_set or warn when not to use it.

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.