Skip to main content
Glama

Update a plugin's settings option

update_plugin_settings
Destructive

Preview a plugin's setting changes as a dry run, then confirm to update the WordPress option, with backup and undo support.

Instructions

Write an option a plugin owns through WordPress's update_option(), so any sanitize callback attached to it runs. Caveat: plugins that register settings only inside wp-admin (Yoast does) have no sanitizer in this request — the preview warns, and for those the plugin's settings screen via submit_admin_form is the sanitized path. Pass changes to deep-merge fields into the existing option (the usual case for a settings array), or value to replace the whole option. The previous value is backed up (last five kept) and can be undone with restore_plugin_settings. The first call is a dry run: it returns the before→after diff (before sanitization — the plugin may adjust or drop values on save) and a confirm_token; re-run with that token to apply, and the result reports what the sanitizer changed. Options wpxmcp protects, and options not attributable to the plugin (unless force_option), are refused. Prefer a plugin's REST route or ability when inspect_plugin shows one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueNoA complete replacement value for the option. Use instead of `changes`, not with it.
optionYesThe option name to write, e.g. "wpseo_titles".
pluginYesPlugin identifier (slug, dir/file, or name).
changesNoFields to deep-merge into the existing option value (for array/object options).
site_idNoWhich configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids.
force_optionNoWrite even when the option is not attributable to this plugin. Off by default as a guard against typos.
confirm_tokenNoToken from the dry-run preview, required to actually apply the write.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A5/5.0
Behavior5/5

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

The annotations already indicate destructive write behavior, but the description goes much further: it discloses the dry-run/confirm_token flow, before→after diff, sanitizer caveats, backup retention, refusal of protected/un-attributable options, and force_option behavior. Nothing material is hidden by the description.

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 description is long but every sentence earns its place, covering core behavior, caveats, parameter modes, backup/undo, dry-run flow, and guardrails. It front-loads the primary verb and resource, then layers necessary detail. No filler or redundancy.

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?

Given 7 parameters, no output schema, and destructive semantics, this description is exceptionally complete: it explains return values (diff, confirm_token, sanitizer results), refusal conditions, alternate sanitized paths, backup retention, and the preference for REST routes. An agent has everything needed to invoke this tool correctly and avoid destructive mistakes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema covers all parameters descriptively, the description adds crucial relational semantics: `changes` is a deep-merge operation while `value` replaces the whole option; confirm_token comes from the dry-run preview; force_option overrides the attribution guard; site_id has default-site behavior. This significantly improves parameter understanding 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 specific action (writing a plugin-owned option through update_option) and the exact resource (a plugin's settings option). It clearly separates this from siblings like restore_plugin_settings and submit_admin_form, so an agent can identify what this tool does and does not do.

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?

The description explicitly explains when to use `changes` vs `value`, warns when the sanitized path is submit_admin_form instead (Yoast example), mentions undo via restore_plugin_settings, and recommends preferring a plugin's REST route or ability when inspect_plugin shows one. This is complete, actionable selection guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools