Create Draft Page
Creates a new page as a draft, authored by the current user. The page is not published. Optionally set a parent page to create it as a sub-page.
| Property | Value |
|---|---|
| Ability slug | mosmcp/page-create-draft |
| Wire tool name | mosmcp__page-create-draft |
| Category | Pages (mosmcp-pages) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_pages |
| Minimum default role | Editor |
| 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 page. |
| content | string | `` | Optional content/body of the new draft page. 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. | |
| parent_id | integer (min 1) | — | Optional ID of a parent page, to create this as a sub-page. | |
| 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. | |
| parent_id | integer | ||
| edit_url | 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
Create a draft page called 'Our Team' under the About page.
Example request (json)
{
"jsonrpc": "2.0",
"id": 32,
"method": "tools/call",
"params": {
"name": "mosmcp__page-create-draft",
"arguments": {
"input": {
"title": "Our Team",
"content": "<p>Meet the people behind the company.</p>",
"parent_id": 12
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 32,
"result": {
"isError": false,
"structuredContent": {
"id": 57,
"title": "Our Team",
"status": "draft",
"slug": "our-team",
"parent_id": 12,
"edit_url": "https://example.com/wp-admin/post.php?post=57&action=edit"
}
}
}
Edge cases / errors
- title is empty after sanitizing → refused with missing_title.
- parent_id does not point to an existing page → refused with parent_not_found; nothing is created.
- slug reduces to nothing URL-safe (e.g. only punctuation) → refused with invalid_slug; a slug that is already taken is stored with a numeric suffix instead.
- The page is always created as draft and authored by the connected user.
- content follows the WordPress editor's rule (since 1.5.2): a user with unfiltered_html (administrators and editors on a single site) saves any HTML, including forms, scripts and styles, exactly as sent. For anyone else, markup they may not save is refused with html_not_allowed (nothing is created; the error names the tags and who may add them), and attributes that had to be removed are reported in warnings (html_attributes_removed). Backslashes are kept.
| << Previous | Next >> |
|---|---|
| Update Post | Delete Page 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.