Set Custom Content Template
Assigns a page template to a custom content item. Only templates the active theme and its plugins register are accepted, so a mistyped name is refused rather than silently falling back to the default.
| Property | Value |
|---|---|
| Ability slug | mosmcp/cpt-template-set |
| Wire tool name | mosmcp__cpt-template-set |
| 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. |
| page_template | string (min length 1) | Yes | — | Template to assign, or "default" for the theme default. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | |
| previous | string | Yes | Template slug before the change. |
| current | string | Yes | Template slug after the change. |
| label | string | ||
| changed | boolean | Yes | |
| view_url | string | ||
| warnings | object[] | Non-fatal issues encountered while running. | |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string |
Example
Sample prompt
Switch the Strategy Workshop service to the Full Width template.
Example request (json)
{
"jsonrpc": "2.0",
"id": 147,
"method": "tools/call",
"params": {
"name": "mosmcp__cpt-template-set",
"arguments": {
"input": {
"post_type": "service",
"id": 42,
"page_template": "templates/full-width.php"
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 147,
"result": {
"isError": false,
"structuredContent": {
"id": 42,
"previous": "default",
"current": "templates/full-width.php",
"label": "Full Width",
"changed": true,
"view_url": "https://example.com/services/strategy-workshop/",
"warnings": []
}
}
}
Edge cases / errors
- Template not registered by the active theme or its plugins → unknown_page_template, listing the available ones.
- "default" returns the item to the theme default template.
- Value reads back differently after saving (usually a plugin filter) → saved with a template_not_stored warning.
| << Previous | Next >> |
|---|---|
| Set Custom Content Status | Set Custom Field |
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.