Find Text in Templates


Searches every template and template part for some wording — for example to find where the footer copyright line or a phone number lives — including pending draft changes. Quotes, ampersands and spacing are matched forgivingly. Read-only.

Property Value
Ability slug mosmcp/theme-text-find
Wire tool name mosmcp__theme-text-find
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
text string Yes — Wording to find.
scope string (one of all, templates, parts) all Where to look.

 

Output schema

Field Type Required Description
searched_for string
items_found integer Yes
items object[] Yes
items[].type string "template" or "part".
items[].slug string
items[].title string
items[].occurrences integer
items[].match_mode string
items[].snippets string[]
items[].from_patterns string[] Theme patterns the wording actually lives in, when the template only references them.
notes string[]

 

Example

Sample prompt
Where does the footer copyright text '2024 Example Co' live in my theme?

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 282,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-text-find",
    "arguments": {
      "input": {
        "text": "2024 Example Co",
        "scope": "parts"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 282,
  "result": {
    "isError": false,
    "structuredContent": {
      "searched_for": "2024 Example Co",
      "items_found": 1,
      "items": [
        {
          "type": "part",
          "slug": "footer",
          "title": "Footer",
          "occurrences": 1,
          "match_mode": "exact",
          "snippets": [
            "...(c) 2024 Example Co. All rights reserved..."
          ],
          "from_patterns": [
            "twentytwentyfive/footer"
          ]
        }
      ],
      "notes": []
    }
  }
}

 

Edge cases / errors

  • Blank text -> refused with mosmcp_empty_search_text.
  • No match anywhere -> success with items_found 0 and a note to use mosmcp/content-find-in-posts for page/post content.
  • Wording that lives in a theme pattern the template only references is still found; from_patterns names that pattern. Up to 5 snippets per item.
  • 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 >>
Delete Pattern Find Where a Pattern Is Used

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.