Get Pattern


Returns one pattern's block markup: a registered pattern by name, or a pattern saved on this site by ID. Read-only.

Property Value
Ability slug mosmcp/theme-pattern-get
Wire tool name mosmcp__theme-pattern-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
name string — Registered pattern name, for example "twentytwentyfive/hero". Use this or "id".
id integer (min 1) — Saved pattern ID. Use this or "name".

 

Output schema

Field Type Required
kind string
name string
id integer
title string Yes
synced boolean
content string Yes
pending string
notes string[]

 

Example

Sample prompt
Show me the markup of the theme's hero pattern.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 285,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-pattern-get",
    "arguments": {
      "input": {
        "name": "twentytwentyfive/hero"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 285,
  "result": {
    "isError": false,
    "structuredContent": {
      "kind": "registered",
      "name": "twentytwentyfive/hero",
      "id": 0,
      "title": "Hero",
      "synced": false,
      "content": "<!-- wp:group {\"align\":\"full\"} --><div class=\"wp-block-group alignfull\">...</div><!-- /wp:group -->",
      "pending": "",
      "notes": [
        "Registered patterns are read-only. To use it, insert this content into a page or template."
      ]
    }
  }
}

 

Edge cases / errors

  • No pattern with that name or id (or the ID is not a saved pattern post) -> refused with mosmcp_pattern_not_found, pointing to mosmcp/theme-pattern-list.
  • When both are given, id is used first.
  • Saved pattern with a staged edit -> the draft title/content is returned with pending "update" and a note that it is not live yet.

 


<< Previous Next >>
Get Global Styles Get Theme JSON

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.