Skip to main content
Glama

wp_update_page

Modify existing WordPress pages by updating content, titles, or status through the MCP WordPress Server. Change page details without creating new content.

Instructions

Updates an existing 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 update.
titleNoThe new title for the page.
contentNoThe new content for the page, in HTML format.
statusNoThe new status for the page.

Implementation Reference

  • The main handler function for the wp_update_page tool. It casts parameters to UpdatePageRequest type, calls the WordPressClient's updatePage method, and returns a success message or throws an error.
    public async handleUpdatePage(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const updateParams = params as unknown as UpdatePageRequest & { id: number };
      try {
        const page = await client.updatePage(updateParams);
        return `✅ Page ${page.id} updated successfully.`;
      } catch (_error) {
        throw new Error(`Failed to update page: ${getErrorMessage(_error)}`);
      }
    }
  • The tool registration object returned by PageTools.getTools(), defining the name, description, input parameters schema, and binding to the handleUpdatePage handler. This is collected by ToolRegistry and registered with the MCP server.
    {
      name: "wp_update_page",
      description: "Updates an existing page.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The ID of the page to update.",
        },
        {
          name: "title",
          type: "string",
          description: "The new title for the page.",
        },
        {
          name: "content",
          type: "string",
          description: "The new content for the page, in HTML format.",
        },
        {
          name: "status",
          type: "string",
          description: "The new status for the page.",
          enum: ["publish", "draft", "pending", "private"],
        },
      ],
      handler: this.handleUpdatePage.bind(this),
    },
  • TypeScript interface defining the input shape for updating a page, extending CreatePageRequest with required id. Used for type safety in the handler.
    export interface UpdatePageRequest extends Partial<CreatePageRequest> {
      id: number;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Updates an existing page' implies a mutation operation, but it doesn't specify required permissions, whether changes are reversible, potential side effects (e.g., affecting revisions), or rate limits. This is inadequate for a mutation tool with zero annotation coverage.

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 'Updates an existing page' is a single, efficient sentence that is front-loaded with the core purpose. There is zero waste or redundancy, making it highly concise and well-structured for quick comprehension.

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?

For a mutation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It lacks behavioral context (e.g., permissions, side effects), usage guidelines, and details on return values, leaving significant gaps for an AI agent to operate safely and effectively.

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%, with all 5 parameters well-documented in the schema (e.g., 'id' as the page ID, 'content' as HTML). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 where the schema does the heavy lifting.

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 'Updates an existing page' clearly states the action (update) and resource (page), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like wp_update_post or wp_update_category, which follow the same pattern for different resource types, so it misses full sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing page ID), exclusions, or comparisons to tools like wp_create_page or wp_delete_page, leaving the agent to infer usage from context alone.

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