Get Post Template And Display Settings


Reports which page template a post uses, whether Elementor controls its layout, and the per-post theme settings (sidebar, content width, title visibility) that decide how it renders. Use this to find out why one post looks different from another.

Property Value
Ability slug mosmcp/post-template-get
Wire tool name mosmcp__post-template-get
Category Posts (mosmcp-posts)
Plan Free

 

Required access

Requirement Value
Capability edit_post (checked against the specific post)
Minimum default role Contributor
Annotations readOnly: true · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — The ID of the post to inspect.

 

Output schema

Field Type Required Description
id integer Yes
post_type string Yes
title string
page_template object Yes
page_template.current string Assigned template slug, or "default".
page_template.label string
page_template.is_available boolean False when the stored template is not registered by the active theme, which means WordPress renders the default instead.
page_template.available object[] Templates the active theme and its plugins register for this post type.
elementor object
elementor.plugin_active boolean
elementor.has_data boolean Whether this post carries an Elementor layout.
elementor.data_bytes integer
elementor.edit_mode string
elementor.template_type string
elementor.version string
display_settings object[] Per-post theme and plugin settings whose names suggest they affect layout.
display_settings[].key string
display_settings[].value string

 

Example

Sample prompt
Why does post 42 look different from my other posts? Check which template and layout settings it uses.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 9,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__post-template-get",
    "arguments": {
      "input": {
        "id": 42
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 9,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 42,
      "post_type": "post",
      "title": "Autumn Sale",
      "page_template": {
        "current": "default",
        "label": "",
        "is_available": false,
        "available": [
          {
            "slug": "default",
            "label": "Default template"
          },
          {
            "slug": "elementor_header_footer",
            "label": "Elementor Full Width"
          }
        ]
      },
      "elementor": {
        "plugin_active": true,
        "has_data": true,
        "data_bytes": 18422,
        "edit_mode": "builder",
        "template_type": "wp-post",
        "version": "3.24.0"
      },
      "display_settings": [
        {
          "key": "site-sidebar-layout",
          "value": "no-sidebar"
        }
      ]
    }
  }
}

 

Edge cases / errors

  • id that is not a post → post_not_found.
  • A stored template the active theme no longer registers → is_available is false, meaning WordPress renders the default instead.
  • display_settings is a name-based heuristic (keys containing words like layout, sidebar, width, header); Elementor keys and the template key are reported separately, and long values are cut to 200 characters.

 


<< Previous Next >>
Get Post List All Posts

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.