Skip to main content
Glama
gaupoit

WordPress MCP Server

by gaupoit

wp_update_post

Modify existing WordPress posts by updating title, content, status, or excerpt using the post ID. This tool helps maintain current content and manage publishing workflows.

Instructions

Update an existing WordPress post.

Args:
    post_id: The ID of the post to update.
    title: New title (optional).
    content: New content (optional).
    status: New status - 'draft', 'publish', 'pending', 'private', 'trash' (optional).
    excerpt: New excerpt (optional).

Returns:
    Updated post with id, title, status, date, and link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYes
titleNo
contentNo
statusNo
excerptNo

Implementation Reference

  • MCP tool handler function for 'wp_update_post'. Includes input schema via type hints and docstring, registered using @mcp.tool() decorator, delegates to WordPressClient.update_post.
    @mcp.tool()
    def wp_update_post(
        post_id: int,
        title: str | None = None,
        content: str | None = None,
        status: str | None = None,
        excerpt: str | None = None,
    ) -> dict:
        """Update an existing WordPress post.
    
        Args:
            post_id: The ID of the post to update.
            title: New title (optional).
            content: New content (optional).
            status: New status - 'draft', 'publish', 'pending', 'private', 'trash' (optional).
            excerpt: New excerpt (optional).
    
        Returns:
            Updated post with id, title, status, date, and link.
        """
        client = get_client()
        return client.update_post(
            post_id=post_id, title=title, content=content, status=status, excerpt=excerpt
        )
  • Core implementation logic in WordPressClient.update_post method: constructs update data, performs POST to WP REST API endpoint /posts/{post_id}, returns simplified post info.
    def update_post(
        self,
        post_id: int,
        title: str | None = None,
        content: str | None = None,
        status: str | None = None,
        excerpt: str | None = None,
    ) -> dict:
        """Update an existing post."""
        data = {}
        if title is not None:
            data["title"] = title
        if content is not None:
            data["content"] = content
        if status is not None:
            data["status"] = status
        if excerpt is not None:
            data["excerpt"] = excerpt
    
        if not data:
            raise ValueError("At least one field must be provided to update")
    
        post = self._post(f"posts/{post_id}", data)
    
        return {
            "id": post["id"],
            "title": post["title"]["rendered"],
            "status": post["status"],
            "date": post["date"],
            "link": post["link"],
        }
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral context. It mentions the tool updates posts and describes return values, but doesn't cover important aspects like required permissions, whether changes are reversible, error handling, or rate limits.

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 well-structured with clear sections (Args, Returns), uses bullet-like formatting for parameters, and every sentence adds value. No redundant information or unnecessary elaboration.

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

Completeness3/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 and no annotations or output schema, the description provides good parameter documentation and return value information, but lacks important behavioral context like permissions, side effects, and error conditions that would be needed for safe operation.

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

Parameters4/5

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

Schema description coverage is 0%, but the description provides meaningful parameter documentation including all 5 parameters, their optionality, and for the status parameter, lists all possible enum values ('draft', 'publish', 'pending', 'private', 'trash'). This significantly compensates for the schema gap.

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 clearly states the specific action ('Update an existing WordPress post') and distinguishes it from siblings like wp_create_post (create) and wp_delete_post (delete). It identifies the exact resource being modified.

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

Usage Guidelines3/5

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

The description implies usage by specifying it's for updating existing posts, but doesn't explicitly state when to use this versus wp_create_post or wp_get_post. No guidance on prerequisites, permissions, or error conditions is provided.

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/gaupoit/wordpress-mcp'

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