Update Custom Content Item
Edits the title, body and/or excerpt of a custom content item. Fields the type does not support are refused rather than written where nothing would display them. A custom type's real information usually lives in its custom fields, so use the field abilities for those. This replaces a whole field with the text you supply. To change only part of the text, use mosmcp/content-replace-in-post instead: it is far cheaper on a long page and cannot lose formatting, shortcodes or block markup the way rewriting the whole field can.
| Property | Value |
|---|---|
| Ability slug | mosmcp/cpt-update |
| Wire tool name | mosmcp__cpt-update |
| Category | Custom Content (mosmcp-cpt) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_post (checked against the specific post) |
| Minimum default role | Contributor |
| Annotations | readOnly: false · destructive: false · idempotent: true · openWorld: true |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| post_type | string (min length 1) | Yes | — | Which custom content type to work with, as reported by the list-types ability — for example "service" or "team_member". |
| id | integer (min 1) | Yes | — | The ID of the item. |
| title | string | — | New title. Omit to keep the current one. | |
| content | string | — | New body text. Omit to keep the current text. 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 | — | New excerpt. Pass an empty string to clear it. | |
| 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 | |
| post_type | string | ||
| title | string | Yes | |
| status | string | Yes | |
| slug | string | The URL slug as stored, which may differ from a requested one. | |
| modified | string | ||
| view_url | string | ||
| updated | string[] | Fields that were changed. | |
| edit_url | string | ||
| warnings | object[] | Non-fatal issues encountered while running. | |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string |
Example
Sample prompt
Rename the 'Brand Audit' service to 'Full Brand Audit'.
Example request (json)
{
"jsonrpc": "2.0",
"id": 150,
"method": "tools/call",
"params": {
"name": "mosmcp__cpt-update",
"arguments": {
"input": {
"post_type": "service",
"id": 57,
"title": "Full Brand Audit"
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 150,
"result": {
"isError": false,
"structuredContent": {
"id": 57,
"post_type": "service",
"title": "Full Brand Audit",
"status": "draft",
"slug": "brand-audit",
"modified": "2026-09-29 10:12:44",
"view_url": "https://example.com/?post_type=service&p=57",
"updated": [
"title"
],
"edit_url": "https://example.com/wp-admin/post.php?post=57&action=edit",
"warnings": []
}
}
}
Edge cases / errors
- None of title, content, excerpt or slug given → nothing_to_update.
- content/excerpt on a type that doesn't support it → field_not_supported.
- Changing the slug of a published item → warning published_url_changed, or published_url_changed_no_redirect for hierarchical types, where the old URL now returns 404.
- Item is built with Elementor → the text is saved, but a content_hidden_by_elementor warning says visitors still see the Elementor layout.
| << Previous | Next >> |
|---|---|
| Trash Custom Content Item | Find Text in a Setting |
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.