List Theme Template Parts


Lists a block theme's template parts — the reusable pieces such as the header, footer and sidebar that templates include — with their area, where their content comes from, and any pending draft change. Read-only.

Also known as: header, footer, site header, site footer, sidebar.

Property Value
Ability slug mosmcp/theme-part-list
Wire tool name mosmcp__theme-part-list
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
search string — Optional. Only parts whose slug or title contains this.
area string (one of header, footer, sidebar, uncategorized) — Optional. Only parts in this area.

 

Output schema

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

 

Example

Sample prompt
List the header and footer parts in my theme.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 291,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-part-list",
    "arguments": {
      "input": {
        "area": "footer"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 291,
  "result": {
    "isError": false,
    "structuredContent": {
      "theme": "twentytwentyfive",
      "count": 1,
      "customised": 0,
      "items": [
        {
          "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": 96
        }
      ],
      "notes": [
        "origin \"theme\" means the theme file is used as shipped; \"customised\" means an edit made in the Site Editor overrides the theme file and can be reset; \"user\" means the template was created on this site and has no theme file."
      ]
    }
  }
}

 

Edge cases / errors

  • Active theme is a classic theme (no block templates) -> refused with mosmcp_not_a_block_theme, pointing to mosmcp/theme-file-list instead.
  • area outside header/footer/sidebar/uncategorized -> rejected by schema validation.
  • No parts match search/area -> success with count 0 and empty items.

 


<< Previous Next >>
List Style Variations List Theme Templates

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.