List Theme Files


Lists the active theme's files with their size, whether each can be read and written, and any change pending in the draft. Shows the draft copy when theme files have been changed there, otherwise the live theme. Read-only.

Also known as: theme code, theme source, functions.php, style.css, theme folder.

Property Value
Ability slug mosmcp/theme-file-list
Wire tool name mosmcp__theme-file-list
Category Theme: Files (mosmcp-theme-files)
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
path string — Optional sub-folder to list, for example "templates" or "assets/css".
source string (one of draft, live) draft "draft" (the default: the draft copy when theme files have been changed there) or "live".

 

Output schema

Field Type Required Description
theme string
source string
count integer Yes
truncated boolean
files object[] Yes
files[].path string
files[].size integer
files[].type string "text" or "binary".
files[].writable boolean
files[].protected boolean The theme cannot work without this file, so it cannot be deleted. It can still be edited.
files[].pending string
notes string[]

 

Example

Sample prompt
Show me the files in my theme's templates folder.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 303,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-file-list",
    "arguments": {
      "input": {
        "path": "templates"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 303,
  "result": {
    "isError": false,
    "structuredContent": {
      "theme": "twentytwentyfive",
      "source": "live",
      "count": 2,
      "truncated": false,
      "files": [
        {
          "path": "templates/index.html",
          "size": 1240,
          "type": "text",
          "writable": true,
          "protected": true,
          "pending": ""
        },
        {
          "path": "templates/single.html",
          "size": 980,
          "type": "text",
          "writable": true,
          "protected": false,
          "pending": ""
        }
      ],
      "notes": []
    }
  }
}

 

Edge cases / errors

  • No theme file changed in the draft yet → the live theme is listed and source is "live" even when "draft" was requested.
  • path is not a folder in the theme → mosmcp_theme_file_not_found; paths using ".." or absolute paths → mosmcp_theme_path_invalid.
  • More than 1000 files → the list is cut off and truncated is true.
  • Child theme → only the child's own files are listed, with a note naming the parent.

 


<< Previous Next >>
Edit Theme File Outline Theme File

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.