Skip to main content
Glama

list_dir

Returns a clean, token-efficient directory tree up to depth N while omitting permissions, timestamps, and ignored folders like node_modules and .git, replacing verbose ls -la.

Instructions

Returns a clean, token-efficient directory tree up to depth N without permissions, timestamps, or ignored folders (node_modules, .git, dist, .env). Replaces verbose ls -la. Pass '.' for project root or a subfolder like 'src'.

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": "list_dir"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath to the directory (relative to workspace or absolute, e.g. '.', './src')
depthNoMaximum traversal depth (default: 2, max: 4)
max_entriesNoMaximum entries to display before pruning (default: 80)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.8.4

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does meaningful work: it discloses output filtering (no permissions, timestamps), a hard-coded ignore list (node_modules, .git, dist, .env), and the token-efficiency intent. It does not state behavior on invalid/missing paths, whether the ignore list is fixed or overridable, or the exact output shape (nested tree vs flat list).

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 sentences, front-loaded with the core capability, then the exclusion policy, then a practical invocation hint. Every sentence carries information; only 'Replaces verbose ls -la' is arguably decorative, though it usefully frames the intent.

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?

A three-parameter read tool with no annotations and no output schema needs the description to explain output characteristics, which it largely does (filtered, token-efficient, depth-bounded, pruned at max_entries). Missing are error behavior and confirmation of whether the ignore list is a fixed policy, which is a modest gap for a tool of this simplicity.

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%, so all three parameters are already documented with defaults and bounds. The description adds an example of valid path values ('.', 'src') which slightly clarifies the relative-path convention, but adds no new meaning for depth or max_entries. Baseline 3 is appropriate.

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 opens with a specific verb+resource combination ('Returns a clean, token-efficient directory tree') and immediately bounds it by depth and excluded metadata. It distinguishes itself from a raw 'ls -la' but never names how it differs from siblings like scoped_search or get_architecture_graph, so the reader must infer that this is the plain filesystem-listing option.

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?

'Replaces verbose ls -la' and 'Pass "." for project root or a subfolder like "src"' give a clear sense of when this tool is the right reach. However, there is no explicit when-not guidance or named alternative for cases like searching file contents or mapping architecture, so usage is implied rather than directed.

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