Skip to main content
Glama

Frontman for WordPress

wp_update_theme_mod

Destructive

Updates one registered top-level Customizer theme mod for the active theme using its permissions, validation, sanitization and save API. Read wp_get_theme_mod first and pass its stylesheet. Requires confirm=true after user approval. Unregistered settings, option settings and indexed settings are not supported. Returns observed persisted before/after values; verify the rendered site separately.

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": {
      "site_id": "<site_id>",
      "name": "<name>",
      "value": "<value>",
      "stylesheet": "<stylesheet>",
      "confirm": "<confirm>"
    },
    "name": "wp_update_theme_mod"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesExact registered theme mod name, e.g. header_button_text.
valueYesNew value, validated and sanitized by the registered Customizer setting.
confirmYesMust be true after the user approves the theme setting change.
site_idYesThe connected site's id returned by list_sites. Call list_sites first; do not use a URL or WordPress post ID.
stylesheetYesExpected active stylesheet from wp_get_theme_mod.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, so the risk profile is partly covered; the description still adds real value by noting the write goes through the registered setting's permissions, validation and sanitization, that a confirm gate is mandatory, and that the return is an observed persisted before/after value. The closing warning to verify the rendered site separately is a genuinely useful behavioral caveat beyond the annotations. It stops short of naming rollback or failure modes for a destructive write.

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?

Four short sentences, each carrying distinct information: purpose, prerequisite ordering, exclusions, and return/verification semantics. The prerequisite and confirm requirement are front-loaded before the caveats, and there is no redundant or filler wording.

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, and the description compensates by describing what comes back ('observed persisted before/after values') and warning that rendering must be checked separately. For a destructive, five-required-parameter mutation tool, this covers the gaps an agent would otherwise have to guess at.

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 all five parameters are already documented, including the stylesheet-from-wp_get_theme_mod relationship and the confirm gate. The description mostly restates that schema content; its only added nuance is the 'registered top-level' constraint on name, which maps loosely to the indexed/option exclusions. Baseline 3 is appropriate when the schema carries the parameter burden.

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 and resource — 'Updates one registered top-level Customizer theme mod for the active theme' — and immediately bounds the scope by declaring that option settings, indexed settings and unregistered settings are out of scope. That scoping sentence effectively separates it from sibling writers like wp_update_option and wp_update_customizer_setting without naming them.

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 prerequisite chain: read wp_get_theme_mod first, pass its stylesheet, and set confirm=true after user approval. It also states clear exclusions ('Unregistered settings, option settings and indexed settings are not supported'), so an agent knows both when to call it and when to route elsewhere.

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.