Create Draft


Creates a new post as a draft, authored by the current user. The post is not published.

Property Value
Ability slug mosmcp/post-create-draft
Wire tool name mosmcp__post-create-draft
Category Posts (mosmcp-posts)
Plan Free

 

Required access

Requirement Value
Capability edit_posts
Minimum default role Contributor
Annotations readOnly: false · destructive: false · idempotent: false · openWorld: false

 

Input schema

Field Type Required Default Description
title string (min length 1) Yes — The title of the new draft.
content string `` Optional content/body of the new draft. HTML is saved the way the WordPress editor saves it: a user with the unfiltered_html capability can save any markup, including forms, scripts and styles, and markup a user is not allowed to save is refused with the reason rather than silently removed. Backslashes are kept. On sites that use the block editor, write it as block markup, the format the editor saves (for example <!-- wp:heading --><h2 class="wp-block-heading">Title</h2><!-- /wp:heading --> then <!-- wp:paragraph --><p>Text</p><!-- /wp:paragraph -->), so each heading, paragraph or button can be edited on its own later. Plain HTML is saved as one "Classic" block. For a new page it is often simplest to create it with a title only and add the content with mosmcp/block-insert, which builds the blocks for you.
excerpt string `` Optional excerpt for the new draft.
slug string — New URL slug. Omit to leave the address unchanged. Reduced to a URL-safe form, and a suffix is added if it is already taken.

 

Output schema

Field Type Required Description
id integer Yes
title string Yes
status string Yes
slug string The URL slug as stored, which may differ from a requested one.
edit_url string
view_url string
post_type string
warnings object[] Notes about the save, such as attributes that could not be kept or content that WordPress changed while saving.
warnings[].code string
warnings[].message string
warnings[].context string

 

Example

Sample prompt
Start a new draft post called 'Spring Menu Launch' with a short intro paragraph.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__post-create-draft",
    "arguments": {
      "input": {
        "title": "Spring Menu Launch",
        "content": "<p>Our new spring menu arrives next week.</p>"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 42,
      "title": "Spring Menu Launch",
      "status": "draft",
      "slug": "spring-menu-launch",
      "edit_url": "https://example.com/wp-admin/post.php?post=42&action=edit"
    }
  }
}

 

Edge cases / errors

  • title that is empty after sanitizing (e.g. only HTML tags) → refused with missing_title.
  • slug with no letters or numbers once made URL-safe → refused with invalid_slug; a slug already taken is stored with a numeric suffix and the stored value is returned in slug.
  • The post is always created as a draft authored by the current user; content is filtered through WordPress's allowed-HTML rules, so scripts and unsafe markup are stripped.

 


<< Previous Next >>
Compare Post Settings Delete Post Permanently

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.