Set Page Template
Assigns a page template to a page, for example one of Elementor's full-width or canvas templates. Only templates the active theme and its plugins actually register are accepted, so a mistyped slug is refused instead of silently falling back to the default.
| Property | Value |
|---|---|
| Ability slug | mosmcp/page-template-set |
| Wire tool name | mosmcp__page-template-set |
| Category | Pages (mosmcp-pages) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_post (checked against the specific post) |
| Minimum default role | Editor |
| Annotations | readOnly: false · destructive: false · idempotent: true · openWorld: true |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | integer (min 1) | Yes | — | The ID of the page to update. |
| page_template | string (min length 1) | Yes | — | Template slug to assign, or "default" for the theme default. Read the page first to list the slugs available on this site. |
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 Landing page to Elementor's full-width template.
Example request (json)
{
"jsonrpc": "2.0",
"id": 50,
"method": "tools/call",
"params": {
"name": "mosmcp__page-template-set",
"arguments": {
"input": {
"id": 42,
"page_template": "elementor_header_footer"
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 50,
"result": {
"isError": false,
"structuredContent": {
"id": 42,
"previous": "default",
"current": "elementor_header_footer",
"label": "Elementor Full Width",
"changed": true,
"view_url": "https://example.com/landing/",
"warnings": []
}
}
}
Edge cases / errors
- page_template is not registered by the active theme or its plugins → refused with unknown_page_template, and the error lists the valid slugs.
- page_template is default → the stored template is removed so the theme default applies.
- The value reads back differently after saving (a plugin filtering it) → a template_not_stored warning is returned.
- id is not a page → refused with post_not_found. Assigning the current template again returns changed: false.
| << Previous | Next >> |
|---|---|
| Set Page Featured Image | Set Page to Pending Review |
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.