Skip to main content
Glama

Restore a revision

restore_revision
DestructiveIdempotent

Restore a post or page to a selected revision, replacing its title, content, and excerpt while preserving status, publish date, slug, categories, and tags.

Instructions

Restore a post or page to one of its revisions: its title, content and excerpt are replaced with the revision's. The status, publish date, slug, categories and tags are not changed, so a published post stays published with the restored content. The restore can usually be undone the same way, because WordPress keeps the previous content as a revision when revisions are enabled; depending on the site's revision settings it may not be kept, so read the current content with get_post first if it must be kept. Returns the post's ID, title and the restored revision.

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": {
      "post_id": "<post_id>",
      "revision_id": "<revision_id>"
    },
    "name": "restore_revision"
  }
}

Input Schema

NameRequiredDescriptionDefault
post_idYesPost or page ID
post_typeNoPost type of post_id: 'post' (the default), 'page', or an allowed custom post type.post
revision_idYesRevision ID to restore, from get_revisions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.30.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations (destructive, idempotent, not read-only), the description discloses precisely what is overwritten (title, content, excerpt) and what is left intact (status, date, slug, categories, tags), plus the reversibility caveat tied to revision settings and the fact that the previous content is preserved as a new revision. That is materially more than the structured hints provide.

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 sentences, front-loaded with the action and the replaced-field scope, followed by preserved fields and then the safety caveat. Every sentence carries distinct information with no repetition of the name or title.

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 still reports the return payload (post ID, title, restored revision), and for a destructive mutation with three parameters it covers scope, side effects, and recovery options—everything needed to call 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 100%, so the schema already documents post_id, post_type and revision_id, including the get_revisions reference and the enum. The description adds little parameter-level meaning beyond that, which merits the baseline 3.

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 names a specific verb and resource ('Restore a post or page to one of its revisions') and enumerates exactly which fields are rewritten versus preserved, so an agent can distinguish this mutation from reads like get_revision or get_post without opening any 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?

It gives clear conditional guidance: read the current content with get_post first if the pre-restore state must be kept, and points to get_revisions as the source of revision_id. It lacks explicit exclusions (e.g., when not to restore at all, or how to choose among revisions), so it falls short of full when/when-not coverage.

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