Skip to main content
Glama

List theme files

list_theme_files
Read-only

List files in a WordPress theme or theme draft with their sizes to review the template structure before reading or editing. Identify the correct file by seeing the full hierarchy.

Instructions

List the files in a theme (or theme draft) with sizes, so you can see the template structure before reading or editing anything.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
themeNoTheme stylesheet or draft id. Defaults to the active theme.
subdirNoRestrict the listing to this subdirectory, e.g. "template-parts".
site_idNoWhich configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false, so the description does not need to prove safety. It adds useful scope context (theme or draft) and the fact that results include sizes, but it does not disclose additional behavior such as whether file contents are omitted or how drafts are prioritized.

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?

The description is a single, well-structured sentence with no filler. The primary action and output are stated up front, and the purpose clause adds context without redundancy.

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?

This is a simple, read-only listing tool with no required parameters and fully documented inputs. Even without an output schema, the description gives enough high-level detail about the result (files with sizes) for an agent to know what to expect. It could be more explicit about the exact return shape, but not enough to lower it below a 4.

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 schema fully documents all three optional parameters. The description adds no parameter-level detail beyond what the schema already provides, so a baseline score of 3 is appropriate.

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 clearly states the verb (List), the resource (files in a theme or theme draft), and the output characteristic (with sizes). It also conveys the intent of inspecting template structure before editing, which distinguishes it from sibling tools like list_themes or read_theme_file.

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?

The description includes a clear usage context: use this to see template structure before reading or editing anything. It does not explicitly name alternative tools or exclusions, but the intended workflow is evident enough for an agent to decide when to call it.

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