Skip to main content
Glama
Leonelberio

WordPress MCP Server

by Leonelberio

update_post

Modify an existing WordPress post by updating its title, content, or status using the WordPress MCP Server. Requires post ID and site credentials for authentication and customization.

Instructions

Update an existing WordPress post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNoNew post content
passwordNoWordPress password (overrides WORDPRESS_PASSWORD env var)
postIdYesPost ID to update
siteUrlNoWordPress site URL (overrides WORDPRESS_SITE_URL env var)
statusNoNew post status (draft, publish, etc.)
titleNoNew post title
usernameNoWordPress username (overrides WORDPRESS_USERNAME env var)

Implementation Reference

  • Executes the update_post tool by validating the postId parameter, conditionally adding title, content, or status to the update data, and performing a POST request to the WordPress REST API endpoint `/posts/{postId}` to update the post.
    case 'update_post':
      if (!params.postId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Post ID is required for updating a post'
        );
      }
      const updateData: Record<string, any> = {};
      if (params.title) updateData.title = params.title;
      if (params.content) updateData.content = params.content;
      if (params.status) updateData.status = params.status;
    
      const updateResponse = await client.post(
        `/posts/${params.postId}`,
        updateData
      );
      return updateResponse.data;
  • Tool registration including name, description, and input schema definition for the update_post tool.
    {
      name: 'update_post',
      description: 'Update an existing WordPress post',
      inputSchema: {
        type: 'object',
        properties: {
          siteUrl: {
            type: 'string',
            description: 'WordPress site URL (overrides WORDPRESS_SITE_URL env var)',
          },
          username: {
            type: 'string',
            description: 'WordPress username (overrides WORDPRESS_USERNAME env var)',
          },
          password: {
            type: 'string',
            description: 'WordPress password (overrides WORDPRESS_PASSWORD env var)',
          },
          postId: {
            type: 'number',
            description: 'Post ID to update',
          },
          title: {
            type: 'string',
            description: 'New post title',
          },
          content: {
            type: 'string',
            description: 'New post content',
          },
          status: {
            type: 'string',
            description: 'New post status (draft, publish, etc.)',
          },
        },
        required: ['postId'],
      },
  • src/index.ts:58-165 (registration)
    Registration of the ListToolsRequestSchema handler that exposes the update_post tool in the tools list.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'create_post',
          description: 'Create a new WordPress post',
          inputSchema: {
            type: 'object',
            properties: {
              siteUrl: {
                type: 'string',
                description: 'WordPress site URL (overrides WORDPRESS_SITE_URL env var)',
              },
              username: {
                type: 'string',
                description: 'WordPress username (overrides WORDPRESS_USERNAME env var)',
              },
              password: {
                type: 'string',
                description: 'WordPress password (overrides WORDPRESS_PASSWORD env var)',
              },
              title: {
                type: 'string',
                description: 'Post title',
              },
              content: {
                type: 'string',
                description: 'Post content',
              },
              status: {
                type: 'string',
                description: 'Post status (draft, publish, etc.)',
                default: 'draft',
              },
            },
            required: ['title', 'content'],
          },
        },
        {
          name: 'get_posts',
          description: 'Get WordPress posts',
          inputSchema: {
            type: 'object',
            properties: {
              siteUrl: {
                type: 'string',
                description: 'WordPress site URL (overrides WORDPRESS_SITE_URL env var)',
              },
              username: {
                type: 'string',
                description: 'WordPress username (overrides WORDPRESS_USERNAME env var)',
              },
              password: {
                type: 'string',
                description: 'WordPress password (overrides WORDPRESS_PASSWORD env var)',
              },
              perPage: {
                type: 'number',
                description: 'Number of posts per page',
                default: 10,
              },
              page: {
                type: 'number',
                description: 'Page number',
                default: 1,
              },
            },
          },
        },
        {
          name: 'update_post',
          description: 'Update an existing WordPress post',
          inputSchema: {
            type: 'object',
            properties: {
              siteUrl: {
                type: 'string',
                description: 'WordPress site URL (overrides WORDPRESS_SITE_URL env var)',
              },
              username: {
                type: 'string',
                description: 'WordPress username (overrides WORDPRESS_USERNAME env var)',
              },
              password: {
                type: 'string',
                description: 'WordPress password (overrides WORDPRESS_PASSWORD env var)',
              },
              postId: {
                type: 'number',
                description: 'Post ID to update',
              },
              title: {
                type: 'string',
                description: 'New post title',
              },
              content: {
                type: 'string',
                description: 'New post content',
              },
              status: {
                type: 'string',
                description: 'New post status (draft, publish, etc.)',
              },
            },
            required: ['postId'],
          },
        },
      ],
    }));
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. While 'Update' implies a mutation operation, the description doesn't mention authentication requirements (though parameters suggest them), permission levels, whether changes are reversible, or what happens to unspecified fields. 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 is a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized and front-loaded, making it easy for an agent to quickly understand what the tool does.

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 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain authentication requirements (implied by parameters but not stated), error conditions, return values, or behavioral nuances. The agent would need to rely heavily on the schema and trial-and-error.

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?

The schema has 100% description coverage, so all parameters are documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema, which is acceptable given the high schema coverage. The baseline of 3 reflects that 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 clearly states the action ('Update') and resource ('an existing WordPress post'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling 'create_post' tool beyond the obvious 'existing' vs 'new' distinction, which is why it doesn't reach a perfect score.

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 like 'create_post' or 'get_posts'. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent to infer usage from the tool name 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

Related 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/Leonelberio/the-wordpress-mcp-server'

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