Skip to main content
Glama
gaupoit

WordPress MCP Server

by gaupoit

wp_create_post

Create and publish WordPress posts with customizable content, status, and excerpts using the WordPress REST API.

Instructions

Create a new WordPress post.

Args:
    title: The title of the post.
    content: The content/body of the post (supports HTML and Gutenberg blocks).
    status: Post status - 'draft', 'publish', 'pending', 'private'. Default is 'draft'.
    excerpt: Optional excerpt/summary of the post.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
contentYes
statusNodraft
excerptNo

Implementation Reference

  • Handler function for the 'wp_create_post' tool, including registration via @mcp.tool() decorator and input schema via type hints and docstring. Delegates to WordPressClient.create_post.
    @mcp.tool()
    def wp_create_post(
        title: str,
        content: str,
        status: str = "draft",
        excerpt: str | None = None,
    ) -> dict:
        """Create a new WordPress post.
    
        Args:
            title: The title of the post.
            content: The content/body of the post (supports HTML and Gutenberg blocks).
            status: Post status - 'draft', 'publish', 'pending', 'private'. Default is 'draft'.
            excerpt: Optional excerpt/summary of the post.
    
        Returns:
            Created post with id, title, status, date, and link.
        """
        client = get_client()
        return client.create_post(title=title, content=content, status=status, excerpt=excerpt)
  • Core helper method in WordPressClient that constructs the POST data and calls the WordPress REST API to create the post.
    def create_post(
        self,
        title: str,
        content: str,
        status: str = "draft",
        excerpt: str | None = None,
    ) -> dict:
        """Create a new post."""
        data = {
            "title": title,
            "content": content,
            "status": status,
        }
        if excerpt:
            data["excerpt"] = excerpt
    
        post = self._post("posts", data)
    
        return {
            "id": post["id"],
            "title": post["title"]["rendered"],
            "status": post["status"],
            "date": post["date"],
            "link": post["link"],
        }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the creation action and return format, but lacks details on permissions required, error conditions, rate limits, or whether the operation is idempotent. The mention of HTML and Gutenberg blocks support adds some behavioral context, but overall disclosure is basic.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns) and front-loaded purpose. Every sentence adds value: the first states the action, subsequent lines explain parameters and returns. It could be slightly more concise by integrating the default status note into the status description more smoothly.

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?

Given no annotations and no output schema, the description does a fair job covering basics: purpose, parameters, and return format. However, for a creation tool with mutation implications, it lacks details on authentication needs, error handling, and side effects. The return description is helpful but not exhaustive (e.g., missing potential error responses).

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%, so the description must compensate. It effectively explains all 4 parameters: title and content are clearly defined, status includes enum values and default, and excerpt is noted as optional. This adds significant meaning beyond the bare schema, though it doesn't detail format constraints or validation rules.

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 ('WordPress post'), making the purpose immediately understandable. It distinguishes from siblings like wp_update_post and wp_delete_post by specifying 'new' creation. However, it doesn't explicitly contrast with wp_get_posts or other retrieval tools beyond the obvious action difference.

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 through the action 'Create a new WordPress post' but provides no explicit guidance on when to use this versus alternatives like wp_update_post for modifications or wp_get_post for retrieval. No prerequisites, exclusions, or comparative context with sibling tools are mentioned.

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