Duplicate Custom Content Item


Copies a custom content item as a new draft, carrying its custom fields, taxonomy terms, featured image, template and Elementor layout across. This is the reliable way to create an item that matches an existing one, because a custom type's appearance and data live in its fields and settings rather than its body text.

Property Value
Ability slug mosmcp/cpt-duplicate
Wire tool name mosmcp__cpt-duplicate
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: false · openWorld: false

 

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".
source_id integer (min 1) Yes — The item to copy. Its fields and settings become the new item's.
title string — Title for the copy. Omit to use the original followed by "(copy)".
status string (one of draft, pending, private, publish) draft Status for the copy. Defaults to draft so it can be reviewed first.
include_content boolean true Whether to copy the body text. Set false to keep the fields and settings but start with empty text.
expected_modified string — Optional. The "modified" value from a previous read; the copy is refused if the source changed since.

 

Output schema

Field Type Required Description
new_id integer Yes
source_id integer Yes
title string Yes
status string Yes
edit_url string
view_url string
copied object
copied.meta_rows integer
copied.taxonomies string[]
copied.thumbnail_id integer
copied.has_elementor boolean
copied.elementor_bytes integer
skipped object[] Data deliberately not copied.
skipped[].key string
skipped[].reason string
rewritten object[] Data cleared because it is unique to the original.
rewritten[].key string
rewritten[].reason string
warnings object[] Non-fatal issues encountered while running.
warnings[].code string
warnings[].message string
warnings[].context string

 

Example

Sample prompt
Make a copy of the 'Strategy Workshop' service so I can turn it into a new one.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 136,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__cpt-duplicate",
    "arguments": {
      "input": {
        "post_type": "service",
        "source_id": 42,
        "title": "Leadership Workshop"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 136,
  "result": {
    "isError": false,
    "structuredContent": {
      "new_id": 61,
      "source_id": 42,
      "title": "Leadership Workshop",
      "status": "draft",
      "edit_url": "https://example.com/wp-admin/post.php?post=61&action=edit",
      "view_url": "https://example.com/?post_type=service&p=61",
      "copied": {
        "meta_rows": 6,
        "taxonomies": [
          "service_category"
        ],
        "thumbnail_id": 318,
        "has_elementor": true,
        "elementor_bytes": 18432
      },
      "skipped": [
        {
          "key": "_edit_lock",
          "reason": "Editing lock belongs to the original."
        }
      ],
      "rewritten": [],
      "warnings": []
    }
  }
}

 

Edge cases / errors

  • The copy is a draft by default; publish/private without the type's publish capability → cannot_publish.
  • expected_modified doesn't match the source's current modified time → source_changed; an unparseable value → invalid_expected_modified.
  • Source is an unsaved auto-draft → source_not_saved; missing source → source_not_found.
  • Copied fields that contain the original's ID or URL raise meta_may_reference_source; a missing featured image raises featured_image_missing.

 


<< Previous Next >>
Describe Custom Content Type Get Custom Content Item

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.