Skip to main content
Glama

wp_set_template_conditions

Set DISPLAY CONDITIONS on an Elementor Theme Builder template and optionally publish it. Conditions use Elementor's include/exclude grammar: include/general (entire site), include/singular/front_page, include/singular/page (all pages), include/singular/page/123 (specific), include/singular/post, include/archive, include/archive/category, exclude/singular/page/12, … This changes what renders SITE-WIDE — review the template first. Requires writes enabled + Xyle Connector v0.3.0+.

Input Schema

NameRequiredDescriptionDefault
publishNoPublish the template after saving conditions
site_idYesThe WordPress site ID
conditionsYesJSON array of condition strings, e.g. ["include/general", "exclude/singular/page/12"]
template_idYesThe template's post ID (from wp_create_template / wp_list_templates)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnly=false, destructive=false, non-idempotent, openWorld), so the bar is lower. The description still adds important context beyond them: the change affects rendering SITE-WIDE, and it requires writes to be enabled plus a minimum connector version.

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 action and impact, then supplies the grammar examples, then the prerequisites. The example list is long but each entry demonstrates a distinct pattern, so it earns its space.

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 4-parameter mutation tool with no output schema, the description covers impact, format, and prerequisites adequately. It omits failure behavior and whether existing conditions are replaced or merged, which would have made it complete.

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 3. The description goes beyond the schema's single example by explaining Elementor's include/exclude grammar with a range of concrete condition forms (include/general, include/singular/page/123, exclude/singular/page/12), which genuinely clarifies how to build the conditions parameter.

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 (set) and resource (DISPLAY CONDITIONS on an Elementor Theme Builder template) plus the optional publish behavior. It is clearly distinguishable from siblings like wp_set_template_status or wp_patch_template.

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?

Provides concrete prerequisites (writes enabled, Xyle Connector v0.3.0+) and a caution to review the template first, which is real when-to-use context. It does not name an alternative sibling (e.g. wp_set_template_status for pure publish toggling) or state exclusions, so it falls 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources