Skip to main content
Glama

Undo a change

wp_undo
Destructive

Reverse one earlier change using its undo token (from the "undo" field of the original result, or from wp_undo_list). dry_run=true shows exactly what would be restored and what refused, without changing anything; wp_undo_discard drops a point without restoring it. Undoing needs the same permission as the original action, and each item is re-checked against the CURRENT state, so an option that has since been protected or a post this account may no longer edit is reported as blocked rather than restored. An undo of a page-builder change (wp_update_builder_element) or of a plugin's ability (wp_run_ability) puts every stored copy of the page back byte for byte and refuses a page that someone has changed since — restoring would throw that newer work away — unless force=true. A fully successful undo consumes the token. A partial one consumes it too and returns rest_token, a new undo point with only what did not come back (of a page-builder change, the pages left out), so a later call retries just that; where nothing came back, the token is kept. Afterwards the page caches of the supported caching plugins are asked to purge the restored posts, and after any other undo (options, settings, theme, files, PHP snippets) every page of this site; page_cache_purged lists them, page_cache_skipped names a cache left out on a multisite network and why. A PHP file of an active plugin or theme that is written back is followed by the same test requests as wp_write_plugin_file runs, and so is a PHP snippet of Code Snippets or WPCode that is written back switched on; probe lists their result per file or snippet. Where the site answered those requests before the undo and does worse after it (a fatal error it did not have, no answer, this MCP endpoint cut), the state before the undo is put back in the same call: the item is listed under failed with the reason, and the token is not consumed, so the undo point stays. Where nothing could be compared, the result is only reported. Forwarded by AlphaBridge Connect to the one site this connection reaches.

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": {
      "token": "<token>"
    },
    "name": "wp_undo"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNoPage-builder undo points only: true restores a page even where it was changed after the change being undone, which throws that later change away. Default false: such a page is reported as blocked (changed_since).
tokenYesThe undo token, e.g. undo_1a2b..., from the undo field of the original result or from wp_undo_list.
dry_runNotrue returns what the undo would restore and changes nothing. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / dry_run / description
      Previous value: -"Preview only, change nothing. Default false."New value: +"true returns what the undo would restore and changes nothing. Default false."
    • changedInput schema / properties / force / description
      Previous value: -"Page-builder undo points only: restore a page even where it was changed after the change being undone, which throws that later change away. Default false: such a page is reported as blocked (changed_since)."New value: +"Page-builder undo points only: true restores a page even where it was changed after the change being undone, which throws that later change away. Default false: such a page is reported as blocked (changed_since)."
    • changedInput schema / properties / token / description
      Previous value: -"The undo token, e.g. undo_1a2b..."New value: +"The undo token, e.g. undo_1a2b..., from the undo field of the original result or from wp_undo_list."
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

The description goes far beyond the annotations by disclosing permission requirements, current-state revalidation, blocked items, byte-for-byte page-builder restoration, token consumption semantics, rest_token behavior, cache purging, post-restore probes, and automatic rollback when the site worsens. This is unusually complete behavioral disclosure for a destructive operation.

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

Conciseness4/5

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

The most important information is front-loaded: reverse using a token, preview with dry_run, and use wp_undo_discard instead when appropriate. The body is dense and long, but the complexity of a destructive undo with rollback, cache, and probe behavior justifies most of its length.

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?

With no output schema, the description carries the full burden of explaining return-relevant outcomes: blocked items, rest_token, failed rollback state, page_cache_purged, page_cache_skipped, and probe results. It is complete enough for an agent to understand the consequences of invoking the tool.

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 100%, and the schema already documents token, dry_run, and force with essentially the same operational meanings. The description reinforces those meanings and adds the blocked-item context, but it does not add much parameter syntax or format detail beyond structured data.

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 opens with a specific verb and resource: reverse one earlier change using its undo token. It immediately distinguishes the tool from wp_undo_discard and wp_undo_list, so an agent can route correctly without inspecting sibling schemas.

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?

It states exactly when to use the tool, where the token comes from, how dry_run previews the effect, and how wp_undo_discard differs by dropping the undo point without restoring anything. It also explains force and permission conditions that determine whether the undo will succeed.

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.

Resources