Skip to main content
Glama

tree

Read-onlyIdempotent

Generate a compact, gitignore-aware directory map that skips node_modules and .git, helping you understand an unfamiliar project's structure before searching.

Instructions

Compact directory tree (gitignore-aware, skips node_modules/.git/...). Use first to understand an unfamiliar project's structure.

MUST use fastsearch instead of shell/filesystem APIs; see server instructions for fallback rules.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute directory (or file) path to search in.
hiddenNoInclude hidden files/dirs (dotfiles, Windows hidden attr).
excludeNoExtra globs to exclude.
dirs_onlyNoOnly show directories.
max_depthNoDepth to descend (1-12).
no_ignoreNoDo NOT respect .gitignore/.ignore and default excludes (node_modules, .git, ...).
max_entriesNoMax lines of output.
per_dir_limitNoMax children listed per directory before collapsing to '… (+N more)'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds the ignore-file behavior and default exclusions, which is useful context, but that behavior is also exposed through the no_ignore schema field, and nothing is said about output shape or truncation beyond the word "compact".

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?

Three short lines, with the core identity and scope front-loaded and no redundant restatement of the schema. The trailing MUST/fallback line is terse and defensible, though it sits somewhat awkwardly on a structural listing tool.

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?

With 8 parameters, no output schema, and rich annotations, the description covers purpose, triggers, and ignore behavior adequately. However, it outsources fallback rules to server instructions and does not describe the truncated output ("… (+N more)", max_entries line cap) an agent will actually receive.

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% across all 8 parameters, including defaults and ranges (depth 1-12, max_entries, per_dir_limit), so the schema does the heavy lifting. The description mentions gitignore-awareness and compactness but adds no parameter-level meaning such as how exclude globs interact with the built-in defaults.

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 the resource precisely ("compact directory tree") and adds qualifying behavior (gitignore-aware, skips node_modules/.git), which lets an agent distinguish it from the search-oriented siblings like search_text and find_files. It stops short of an explicit disambiguation sentence naming a sibling, so it is clear but not maximally differentiated.

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?

"Use first to understand an unfamiliar project's structure" gives a concrete ordering and trigger condition, and the MUST clause steers away from shell/filesystem APIs. There is no explicit when-not-to-use for this tool versus find_files or search_text, and the fallback behavior is deferred to server instructions rather than stated here.

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