Skip to main content
Glama

validate_theme_template

Validates PHP theme template files against WordPress best practices to detect header/footer, The Loop, output escaping, hardcoded script/style, accessibility, and template hierarchy issues.

Instructions

Validate a PHP theme template file against WordPress best practices. Checks for: get_header/get_footer, wp_head/wp_footer, The Loop, output escaping, hardcoded scripts/styles, accessibility, template hierarchy compliance. Template types: index, single, page, archive, category, tag, search, 404, header, footer, sidebar, functions, etc. Theme types: block, classic, hybrid.

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": {
      "code": "<code>",
      "conversationId": "<conversationId>"
    },
    "name": "validate_theme_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe PHP template file content to validate.
revisionNoRevision number.
themeTypeNoTheme type: 'block' for block/FSE themes, 'classic' for traditional PHP themes, 'hybrid' for both.classic
artifactIdNoArtifact ID for tracking revisions.
templateTypeNoThe type of template file being validated.general
conversationIdYesThe conversation ID obtained from learn_wordpress_api.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does add real value by disclosing what the validator inspects (get_header/get_footer, The Loop, escaping, accessibility, template hierarchy), but it never states whether files are modified, what the output/severity structure looks like, or what happens on failure.

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

Conciseness3/5

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

The purpose statement is well front-loaded and the 'Checks for' list earns its place. However, the final two lines restate schema enum values already visible to the agent, consuming roughly a third of the text without adding information.

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

Completeness3/5

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

For a six-parameter tool with no output schema and no annotations, the definition covers what is checked but not what is returned, whether the operation is read-only, or how revision/artifactId tracking works. Parameters are fully schema-documented, but the agent is left guessing about results and side effects.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description's template-type and theme-type enumerations duplicate the schema enums almost verbatim and add no meaning about revision, artifactId, or conversationId handling.

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?

The opening sentence names a specific verb and resource: 'Validate a PHP theme template file against WordPress best practices.' That is enough to separate it from validate_block_json (JSON) and validate_php (generic PHP), though the description never explicitly draws that distinction.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance, and no named alternative among the many sibling validators (validate_php, validate_block_json, analyze_theme). The 'Template types' and 'Theme types' lines read as parameter enumeration rather than decision guidance for an agent.

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