Get Theme Template Part
Returns one template part's block markup, such as the header or footer. By default this is the draft version when a change is pending; ask for "live" or "theme" to see the others. Read-only.
| Property | Value |
|---|---|
| Ability slug | mosmcp/theme-part-get |
| Wire tool name | mosmcp__theme-part-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 part slug, for example "header" or "footer". |
| 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 what's in my site footer.
Example request (json)
{
"jsonrpc": "2.0",
"id": 288,
"method": "tools/call",
"params": {
"name": "mosmcp__theme-part-get",
"arguments": {
"input": {
"slug": "footer"
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 288,
"result": {
"isError": false,
"structuredContent": {
"slug": "footer",
"id": "twentytwentyfive//footer",
"title": "Footer",
"description": "Site footer.",
"type": "wp_template_part",
"area": "footer",
"origin": "theme",
"can_reset": false,
"modified": "",
"pending": "",
"content_length": 52,
"content": "<!-- wp:pattern {\"slug\":\"twentytwentyfive/footer\"} /-->",
"content_source": "draft",
"notes": [
"This only references the theme pattern twentytwentyfive/footer, so its wording and layout live there. mosmcp/theme-text-find and mosmcp/theme-text-replace look inside it, and mosmcp/theme-pattern-get shows its markup."
]
}
}
}
Edge cases / errors
- Unknown slug -> refused with mosmcp_template_part_not_found, listing the part slugs that exist.
- Part that only references a theme pattern -> a note says the real wording lives in that pattern and how to reach it.
- 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 Template | List Patterns |
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.