Skip to main content
Glama

WordPress: Wp theme file write

wordpress_specialist_wp_theme_file_write
Destructive

Writes a file inside a WordPress theme from Base64 content, creates missing parent directories, and can verify SHA-256 to prevent overwriting drifted files.

Instructions

[UNIFIED] Write a file inside a theme. content_base64 is the decoded body (capped at 5 MB, S-18). PHP file writes additionally require edit_themes AND !DISALLOW_FILE_EDIT (S-17); non-PHP writes only need edit_themes. Pass expected_sha256 for optimistic concurrency: the companion compares against the current file's sha256 and returns sha_mismatch (409) on drift (S-19). When create_dirs is true (default) any missing parent directories are created. Requires Airano MCP Bridge v2.14.0+.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site": "<site>",
      "theme_slug": "<theme_slug>",
      "path": "<path>",
      "content_base64": "<content_base64>"
    },
    "name": "wordpress_specialist_wp_theme_file_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
siteYes
theme_slugYes
create_dirsNo
content_base64Yes
expected_sha256No

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past the annotations, which only mark this destructive/non-idempotent: it discloses a 5 MB body cap, the exact capability checks per file type, the 409 ``sha_mismatch`` failure mode on drift, and default directory creation. Those are precisely the facts an agent needs before attempting a destructive write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the action, then moves through size limit, permissions, concurrency, and directory behavior in a compact sequence with no filler. The internal spec references (S-17, S-18, S-19) and the "[UNIFIED]" prefix are noise, but they cost little against the density of the rest.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive six-parameter write this covers permissions, size limits, concurrency, and path creation, which is most of what matters. It stops short of saying whether an existing file is silently overwritten, what happens to a partial write failure, or what the response contains.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage the description has to carry the load, and it explains four of six parameters substantively (base64 body and size cap, sha256 drift check and its error, create_dirs default and behavior). ``site``, ``theme_slug``, and ``path`` are left to inference, though their names are largely self-describing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Write a file inside a theme") with the notable qualifier that ``content_base64`` is the full decoded body, which implicitly separates it from the patch sibling. It never names a sibling or states the boundary explicitly, and the leading "[UNIFIED]" tag does nothing for an agent trying to pick a tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete conditional rules for use: PHP targets need ``edit_themes`` AND ``!DISALLOW_FILE_EDIT`` while non-PHP only needs ``edit_themes``, and ``expected_sha256`` is recommended for optimistic concurrency. What is missing is any explicit routing guidance versus ``wp_theme_file_patch`` or ``wp_theme_file_read``.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools