Get Theme Template


Returns one block theme template's block markup. By default this is the draft version when a change is pending, so edits build on each other; ask for "live" to see what visitors get now, or "theme" for the theme's original. Read-only.

Property Value
Ability slug mosmcp/theme-template-get
Wire tool name mosmcp__theme-template-get
Category Theme: Templates and Styles (mosmcp-theme-blocks)
Plan Free

 

Required access

Requirement Value
Capability edit_theme_options
Minimum default role Administrator (Shop manager too when WooCommerce is active)
Annotations readOnly: true · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
slug string Yes — Template slug, for example "single", "page", "home" or "404".
version string (one of draft, live, theme) draft "draft" (the default: the pending version when there is one), "live" (what visitors get now) or "theme" (as the theme ships it).

 

Output schema

Field Type Required Description
slug string Yes
id string
title string
description string
type string
area string
origin string "theme", "customised", "user" or "plugin".
can_reset boolean
modified string
pending string Pending draft change: "update", "reset" or empty.
content_length integer
content string Yes
content_source string "draft", "live" or "theme".
notes string[]

 

Example

Sample prompt
Show me the markup of my single post template as visitors see it right now.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 287,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-template-get",
    "arguments": {
      "input": {
        "slug": "single",
        "version": "live"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 287,
  "result": {
    "isError": false,
    "structuredContent": {
      "slug": "single",
      "id": "twentytwentyfive//single",
      "title": "Single Posts",
      "description": "Displays a single post.",
      "type": "wp_template",
      "area": "",
      "origin": "customised",
      "can_reset": true,
      "modified": "2026-09-12 14:03:22",
      "pending": "",
      "content_length": 1934,
      "content": "<!-- wp:template-part {\"slug\":\"header\"} /-->
<!-- wp:post-title /-->
<!-- wp:post-content /-->", "content_source": "live", "notes": [] } } }

 

Edge cases / errors

  • Unknown slug -> refused with mosmcp_template_not_found, and the message lists the template slugs the theme does have.
  • version "theme" on a template created on this site -> empty content with a note that the theme has no version of it.
  • Default version "draft" returns the pending staged markup when there is one, with a note that it is not live yet.
  • Active theme is a classic theme (no block templates) -> refused with mosmcp_not_a_block_theme, pointing to mosmcp/theme-file-list instead.

 


<< Previous Next >>
Get Theme JSON Get Theme Template Part

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.