Skip to main content
Glama

list_directory

Read-only

Lists files and subdirectories with sizes within a directory confined to the filesystem base, defaulting to the WordPress root. Use it to inspect allowed directory contents safely.

Instructions

List the contents of a directory (confined to the filesystem base). Returns files and subdirectories with sizes.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoDirectory path. Defaults to the WordPress root.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.2

TDQS

B3.4/5.0
Behavior3/5

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

The readOnlyHint annotation already tells the agent this is a safe read. The description adds useful behavior beyond that: the confinement to the filesystem base and what the return payload contains (files and subdirectories with sizes). It does not mention pagination, ordering, or what happens for a missing or disallowed path, which are the remaining behavioral gaps.

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?

Two short sentences, front-loaded with the action and immediately followed by the scope constraint and return contents. No filler or 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?

For a one-parameter read-only tool with clear annotations and no output schema, the description covers scope and return contents sufficiently. Only minor gaps remain, such as error behavior for invalid or out-of-base paths.

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 coverage is 100% and the single path parameter is already documented with its default (WordPress root). The description contributes a constraint not in the schema, that access is confined to the filesystem base, which is meaningful but marginal; otherwise it adds no format or path syntax detail.

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 names a specific verb and resource ("List the contents of a directory") and adds a scope qualifier, "confined to the filesystem base," that an agent cannot get from the name alone. It does not explicitly contrast with sibling list tools such as list_posts or broken_links, but the filesystem resource is distinct enough that confusion is unlikely.

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 statement of when to use this tool versus alternatives, no prerequisites, and no exclusions beyond the implied read-only nature. The filesystem-base confinement is a boundary, not guidance on tool selection.

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