Skip to main content
Glama

WordPress: Wp theme file patch

wordpress_specialist_wp_theme_file_patch
Destructive

Patch a WordPress theme text file by splicing specific line ranges to replace, insert, or delete content without full-file uploads for iterative CSS and template edits.

Instructions

[UNIFIED] Patch a text file inside a theme with a small line-range splice, avoiding full-file base64 uploads for iterative CSS and template edits. Lines are 1-based and inclusive. To replace lines 10-12 pass from_line=10, to_line=12. To insert before line 10 pass from_line=10, to_line=9. To append pass from_line=line_count+1, to_line=line_count. Empty content deletes the selected range. Pass expected_sha256 for optimistic concurrency; the companion rejects with sha_mismatch (409) if the file changed. Requires Airano MCP Bridge v2.18.3+.

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>",
      "from_line": "<from_line>",
      "to_line": "<to_line>",
      "content": "<content>"
    },
    "name": "wordpress_specialist_wp_theme_file_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
siteYes
contentYes
to_lineYes
from_lineYes
theme_slugYes
expected_sha256No

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false; the description adds genuine context beyond them: empty content deletes the selected range, expected_sha256 provides optimistic concurrency, and a sha_mismatch 409 is returned on conflict, plus a bridge version requirement. It does not cover permissions/auth or whether a backup or revision is created before the mutation.

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?

Dense but front-loaded: purpose first, then line-semantics examples, then deletion and concurrency behavior, then the version gate. Every sentence carries operational information; the '[UNIFIED]' tag and 'the companion' shorthand are the only minor noise.

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 mutation tool with annotations present and no output schema, it covers the mechanics and the primary failure mode (sha_mismatch 409) adequately. It omits the return payload (e.g., resulting sha256) and any notion of permissions or recoverability, which an agent mutating a live theme file would benefit from.

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?

Schema description coverage is 0%, so the description carries the burden and does so for the error-prone parameters: 1-based inclusive line semantics with three worked examples, empty-content deletion, and sha256 concurrency. site, theme_slug, and path are left without any explanation of shape or root-relative form, which keeps this from a 5.

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

Purpose5/5

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

States a specific verb and resource ('Patch a text file inside a theme with a small line-range splice') and scopes it to iterative CSS and template edits. The clause 'avoiding full-file base64 uploads' implicitly separates it from the full-file write sibling, so an agent can pick between them without opening schemas.

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 a clear context for use (small iterative edits) plus three concrete line-range recipes for replace, insert, and append, which is real when-to-use guidance. It never explicitly names the alternatives (full-file write, read-before-patch) or states when to prefer a full write instead, so it stops short of a 5.

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