Skip to main content
Glama

directory_tree

Recursively map a directory's contents into a tree view while skipping node_modules and .git, with optional depth limits to inspect project structure.

Instructions

Recursively build a tree view of a directory's contents (skips node_modules and .git).

Input Schema

NameRequiredDescriptionDefault
pathYes
max_depthNoMaximum recursion depth, default 5

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.3

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it usefully discloses that node_modules and .git are skipped, which is real behavioral content. It omits other important traits: whether the operation is read-only (implied but unstated), what the tree output looks like, truncation or size limits on large directories, and permission failures.

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?

A single front-loaded sentence with the scope and the notable skip rule, and zero filler. Nothing is wasted and the key information leads.

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 simple two-parameter read tool with no annotations and no output schema, the definition covers purpose and skip behavior but says nothing about the shape of the returned tree or how large directories are handled. Adequate to call it, incomplete for predicting its result.

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

Parameters2/5

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

Schema coverage is only 50%: max_depth is documented in the schema, but path has no description and the description only weakly implies it is a directory path. It says nothing about absolute vs relative paths, trailing slashes, or how max_depth interacts with the recursion, so it does not compensate for the coverage gap.

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?

States a specific verb and resource: 'Recursively build a tree view of a directory's contents,' which clearly distinguishes it from flat listing. However, it never names list_directory or search_files as the alternative, so differentiation must be inferred.

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

Usage Guidelines3/5

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

Recursion is the implied selection criterion versus list_directory, and the skip rules hint at scope, but there is no explicit when-to-use/when-not-to-use statement or named alternative. The agent must reason about when a recursive tree beats a flat listing.

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