Skip to main content
Glama
Leonelberio

WordPress MCP Server

by Leonelberio

create_post

Generate and publish WordPress posts by specifying title, content, and status. Automate post creation through REST API integration with JSON-RPC 2.0 protocol.

Instructions

Create a new WordPress post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesPost content
passwordNoWordPress password (overrides WORDPRESS_PASSWORD env var)
siteUrlNoWordPress site URL (overrides WORDPRESS_SITE_URL env var)
statusNoPost status (draft, publish, etc.)draft
titleYesPost title
usernameNoWordPress username (overrides WORDPRESS_USERNAME env var)

Implementation Reference

  • The handler logic for the 'create_post' tool. It validates that title and content are provided, then uses axios to POST to the WordPress /posts endpoint with the provided title, content, and optional status (default 'draft'), returning the created post data.
    case 'create_post':
      if (!params.title || !params.content) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Title and content are required for creating a post'
        );
      }
      const createResponse = await client.post('/posts', {
        title: params.title,
        content: params.content,
        status: params.status || 'draft',
      });
      return createResponse.data;
  • Input schema for the 'create_post' tool, defining properties for siteUrl, username, password, title, content, status with required fields title and content.
    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'],
    },
  • src/index.ts:60-94 (registration)
    Registration of the 'create_post' tool in the ListToolsRequestSchema handler response, including name, description, and full input schema.
    {
      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'],
      },
    },
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 'Create' implies a write operation but fails to mention authentication requirements, potential side effects (e.g., publishing status), or error handling. This leaves significant gaps for a mutation tool.

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 with zero wasted words. It's front-loaded with the core action, making it easy to scan and understand quickly without unnecessary elaboration.

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 6 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on authentication, post-creation behavior (e.g., default status), error cases, or how it differs from sibling tools, leaving 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 all 6 parameters. The description adds no additional parameter semantics beyond what's in the schema, such as explaining relationships between parameters or usage nuances, 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 verb ('Create') and resource ('new WordPress post'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'update_post' beyond the basic action, missing explicit distinction about when to create versus update.

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 like 'update_post' or 'get_posts'. The description lacks context about prerequisites, such as authentication or site setup, leaving usage unclear beyond the basic action.

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