Skip to main content
Glama

wp_patch_template

Edit a template (header/footer/…) IN PLACE by element id — change one value (spacing, a color, hide-on-mobile) WITHOUT rebuilding it. Same op grammar as wp_patch_page: ops = JSON array of {node_id, field, new_value} or {node_id, style:{…}} (classic elements; style Editor V4 elements with wp_v4_style). Get the template id from wp_list_templates, then read its node ids with wp_get_page(post_id=template_id). dry_run previews the diff. Writes-gated, plugin transport, Xyle Connector v0.6.0+.

Input Schema

NameRequiredDescriptionDefault
opsYesJSON array of {node_id, field, new_value} or {node_id, style:{…}}. Editor V4 atomic: prop names (title, paragraph, text, tag, link, image) with bare values are enveloped automatically; {node_id: <e-tabs id>, tabs: {labels, active, order}} rewrites a tabs element keeping panel content. Every patch also types V4 text the Elementor editor showed blank; ops=[] does only that.
dry_runNoPreview the diff without writing
site_idYesThe WordPress site ID
template_idYesThe template post ID (from wp_list_templates)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare mutation and non-idempotence, and the description layers on real operational context: dry_run previews a diff, writes are gated (must be enabled), and a plugin transport plus minimum Xyle Connector version is required. It also discloses that Type V4 text shown blank gets typed as a side effect and that ops=[] performs only that fix.

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

Conciseness4/5

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

Front-loads the core in-place edit claim, then layers grammar, workflow, preview, and gating in a tight sequence; no sentence is filler. The trailing transport/version clause is slightly incidental but legitimately useful for callers.

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 non-idempotent mutation with no output schema, the definition covers what to feed it, how to obtain the ids, how to preview safely, and the write gating. Return-shape detail is absent, but with dry_run described and no output schema declared, the remaining gap is minor.

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 coverage is 100%, so the baseline is already 3, and the description adds cross-references not in the schema (wp_v4_style for Editor V4 styling, wp_patch_page for the op grammar) plus dry_run semantics. It still leaves the exact op envelope syntax to the schema rather than restating it.

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 ('Edit a template ... IN PLACE by element id') and pins the scope to surgical single-value changes rather than a rebuild. The reference to 'Same op grammar as wp_patch_page' cleanly separates it from wp_update_template (full rewrite) and from its own sibling page patcher.

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 selection rule ('change one value ... WITHOUT rebuilding it') and a concrete two-step prerequisite workflow (get id from wp_list_templates, read node ids via wp_get_page). It does not explicitly name wp_update_template as the alternative for full rewrites, so the contrast is implied rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources