Save Pattern


Creates a new saved pattern, or updates a saved one by ID — its content, title, categories, or whether it is synced — staged in the theme draft. A synced pattern shows the same content everywhere it is used, so updating one changes every page that includes it (mosmcp/theme-pattern-usage lists them) — which is why it waits for the draft to be published. Returns insert_markup to place the pattern in a template or part within the same draft. Registered patterns from the theme or plugins cannot be changed.

Also known as: reusable block, reusable section, banner, call to action, unsync pattern, pattern category.

Property Value
Ability slug mosmcp/theme-pattern-save
Wire tool name mosmcp__theme-pattern-save
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: false · destructive: false · idempotent: false · openWorld: false

 

Input schema

Field Type Required Default Description
id integer (min 1) — ID of the saved pattern to update. Omit to create a new one.
title string — Pattern title. Required for a new pattern.
content string — Block markup. Required for a new pattern; omit to keep the current content when only renaming, recategorising or switching sync.
synced boolean — Whether the pattern stays in sync everywhere it is used. A new pattern is synced unless this is false; for an existing one, omit it to keep its current setting.
categories string[] — Pattern category names, replacing its current ones; categories that do not exist yet are created on publish. An empty list removes them all; omit to keep them.

 

Output schema

Field Type Required Description
staged boolean Yes
target string
change string
draft object Yes
draft.exists boolean
draft.change_count integer
draft.templates string[]
draft.template_parts string[]
draft.global_styles string
draft.patterns string[]
draft.files string[]
draft.site_identity string[] Pending logo and site icon changes.
draft.custom_css string[] Pending change to the Customizer's Additional CSS. A block theme's Additional CSS is part of global styles.
draft.theme_settings string[] Pending theme (Customizer) settings.
draft.created string
draft.updated string
draft.preview_ready boolean
next_step string
notes string[]
insert_markup string Block markup that places this pattern in a template or part.

 

Example

Sample prompt
Create a reusable newsletter sign-up banner I can put on several pages.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 297,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-pattern-save",
    "arguments": {
      "input": {
        "title": "Newsletter CTA",
        "content": "<!-- wp:paragraph -->
<p>Join our newsletter.</p>
<!-- /wp:paragraph -->", "synced": true } } } }

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 297,
  "result": {
    "isError": false,
    "structuredContent": {
      "staged": true,
      "target": "the new pattern \"Newsletter CTA\"",
      "change": "created",
      "draft": {
        "exists": true,
        "change_count": 1,
        "templates": [],
        "template_parts": [],
        "global_styles": "",
        "patterns": [
          "Newsletter CTA (create)"
        ],
        "files": [],
        "created": "2026-09-29 10:12:04",
        "updated": "2026-09-29 10:14:37",
        "preview_ready": true
      },
      "next_step": "Nothing has changed on the live site yet. Preview the draft with mosmcp/theme-draft-preview, then publish it with mosmcp/theme-draft-publish.",
      "notes": [
        "To place it, put insert_markup into a template or template part (for example with mosmcp/theme-part-update) in this same draft. It shows in the preview, and publishing creates the pattern and links it there."
      ],
      "insert_markup": "<!-- wp:block {\"ref\":0,\"mosmcpDraftPattern\":\"3f2b8c1e-5d4a-4b7e-9c21-7a6d0e9f1b23\"} /-->"
    }
  }
}

 

Edge cases / errors

  • New pattern without title -> refused with mosmcp_pattern_title_required; empty or unbalanced content -> mosmcp_block_markup_empty / mosmcp_block_markup_broken.
  • id that is not a saved pattern -> refused with mosmcp_pattern_not_found. Registered theme/plugin patterns cannot be changed.
  • Updating a synced pattern changes every page using it once the draft is published; insert_markup is a wp:block reference for synced patterns, or the raw content for unsynced ones.
  • When updating, omitted title/content keep their current values (rename-only is allowed).

 


<< Previous Next >>
Reset Theme Template Part Update Global Styles

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.