Skip to main content
Glama

Theme Templates

theme_templates

List a Drupal theme's Twig templates with sizes, filtered by an optional name pattern, to inspect template files and their byte sizes.

Instructions

List a theme's Twig templates (*.html.twig) with sizes.

Walks the theme directory on the local docroot (symlinks skipped, nothing outside DRUPAL_ROOT reported). pattern is a case-insensitive substring matched against the template name — "node--", "views", "field" — to narrow the list. Returns docroot-relative paths and byte sizes, sorted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternNo
theme_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses that the walk stays on the local docroot, skips symlinks, reports nothing outside DRUPAL_ROOT, and returns sorted docroot-relative paths with byte sizes. These are concrete behavioral constraints an agent cannot get from the schema alone.

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?

Three tight sentences, front-loaded with purpose, then scope/behavior, then parameter meaning. No filler, and each sentence adds an idea that is not restated elsewhere.

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 detailed (though the description briefly mentions paths and sizes anyway). Scope, filtering, and safety constraints are covered; the only shortfall is the absence of sibling-oriented selection context. Fully adequate for a read-only listing tool.

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. It gives pattern strong semantics (case-insensitive substring matched against the template name, with concrete examples like "node--" and "views") that go well beyond the bare string type. theme_name is left implicit, though it is largely self-describing from the name.

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 description states a specific verb and resource ("List a theme's Twig templates (*.html.twig) with sizes"), so an agent immediately knows what the tool produces. It does not, however, differentiate itself from close siblings such as theme_template_overrides, template_suggestions, or theme_search, leaving the agent to infer the 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 explicit when-to-use guidance and no mention of alternatives for a task that has several neighboring tools (theme_template_overrides, theme_search, view_template_info). The pattern-parameter sentence explains narrowing behavior, but that is parameter usage, not tool selection guidance.

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