Skip to main content
Glama

Template Suggestions

template_suggestions

Get the ordered Twig template name suggestions Drupal tries for an entity, bundle, or page, with checked-theme flags showing which files would take effect.

Instructions

Twig template names Drupal will try for an entity, specific first.

The suggestion chain for node, block, taxonomy_term, user, field, or page rendering (bracketed parts are placeholders Drupal fills in, e.g. node--article--123.html.twig beats node--article.html.twig). Unknown entity types get the generic chain. When DRUPAL_ROOT is configured each suggestion is marked in_checked_theme: whether the default theme already ships that file, so you know which name creating one would actually take effect.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bundleNo
entity_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does well: it explains ordering semantics (specific first, with a concrete comparison example), fallback behavior for unknown entity types, and conditional enrichment of output (in_checked_theme when DRUPAL_ROOT is configured). It doesn't address pagination or performance characteristics, but for a read-only suggestion lookup that is minor.

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?

Tight and front-loaded: the purpose is in the first sentence, the example and fallback rules follow, and the conditional enrichment comes last. The parenthetical example adds real value rather than padding, and there is no wasted filler.

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?

An output schema exists, so return values need not be explained, and the description appropriately focuses on semantics the schema can't convey: ordering, fallback, and the in_checked_theme flag. It is nearly complete for a two-param lookup tool, with only the optional/required status of bundle left to the schema.

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 must compensate, and it does: it names the supported entity_type values and clearly explains the bundle placeholder role within the suggestion chain. It doesn't explicitly say bundle is optional/defaults to null or describe format constraints, leaving some schema detail to inference.

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?

The description states a precise verb+resource: it returns the Twig template name suggestion chain Drupal tries for an entity, specific first. It distinguishes itself from siblings like theme_templates and theme_template_overrides by explaining the discovery/priority mechanism rather than just listing files.

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?

Usage is well-contextualized: the supported entity types (node, block, taxonomy_term, user, field, page) are named, and the description explains what the in_checked_theme flag is for (knowing which name creating a file would actually take effect). It stops short of explicitly naming alternatives like theme_template_overrides for when to prefer one over the other.

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