Skip to main content
Glama

wp_get_page_revisions

Retrieve revision history for a WordPress page to track changes, restore previous versions, or compare content updates.

Instructions

Retrieves revisions for a specific page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.
idYesThe ID of the page to get revisions for.

Implementation Reference

  • The main handler function for the 'wp_get_page_revisions' tool. It extracts the page ID from parameters, fetches revisions using WordPressClient.getPageRevisions, formats a user-friendly list of revisions (author and modified date), or returns a no-revisions message. Handles errors gracefully.
    public async handleGetPageRevisions(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const { id } = params as { id: number };
      try {
        const revisions = await client.getPageRevisions(id);
        if (revisions.length === 0) {
          return `No revisions found for page ${id}.`;
        }
        const content =
          `Found ${revisions.length} revisions for page ${id}:\n\n` +
          revisions
            .map((r) => `- Revision by user ID ${r.author} at ${new Date(r.modified).toLocaleString()}`)
            .join("\n");
        return content;
      } catch (_error) {
        throw new Error(`Failed to get page revisions: ${getErrorMessage(_error)}`);
      }
    }
  • Tool registration within PageTools.getTools(). Defines the tool name, description, input parameters (page ID), and binds the handler function for MCP tool registry.
    {
      name: "wp_get_page_revisions",
      description: "Retrieves revisions for a specific page.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The ID of the page to get revisions for.",
        },
      ],
      handler: this.handleGetPageRevisions.bind(this),
    },
  • Input schema definition for the tool, specifying the required 'id' parameter of type number with description.
    {
      name: "wp_get_page_revisions",
      description: "Retrieves revisions for a specific page.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The ID of the page to get revisions for.",
        },
      ],
      handler: this.handleGetPageRevisions.bind(this),
    },
  • Core API helper method in PagesOperations that performs the actual HTTP GET request to WordPress REST API endpoint `/wp-json/wp/v2/pages/{id}/revisions` via the base client.
    async getPageRevisions(id: number): Promise<WordPressPage[]> {
      return this.client.get<WordPressPage[]>(`pages/${id}/revisions`);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data, implying a read-only operation, but doesn't specify authentication needs, rate limits, error conditions, or the format of returned revisions. This leaves significant behavioral aspects undocumented.

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 a single, clear sentence with no wasted words. It's front-loaded with the core purpose, making it efficient and easy to parse, which is ideal for conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., revision details, format), potential side effects, or error handling. For a retrieval tool with no structured output documentation, this leaves critical context gaps.

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 fully documents both parameters ('site' and 'id'). The description adds no additional parameter semantics beyond what's in the schema, such as format examples or constraints, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieves') and resource ('revisions for a specific page'), making the purpose understandable. However, it doesn't differentiate from the sibling tool 'wp_get_post_revisions' which appears to serve a similar function for posts rather than pages, leaving some ambiguity about sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or comparisons to sibling tools like 'wp_get_post_revisions' or 'wp_get_page', leaving the agent to infer usage scenarios independently.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/docdyhr/mcp-wordpress'

If you have feedback or need assistance with the MCP directory API, please join our Discord server