Skip to main content
Glama

List

list
Read-only

List files and subdirectories in a directory as a tree, with pagination, depth control, and options to include hidden or ignored items.

Instructions

List a directory's files and subdirectories as a tree of names, like ls or tree. stat returns sizes and dates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory to list (default: first allowed root)
cursorNoOpaque pagination cursor; pass unchanged for the next page. Pages slice one snapshot taken on the first call; it expires after ~60s — re-request without a cursor if rejected.
maxDepthNoMax directory depth to traverse (default: 1 = top-level only; increase to recurse deeper)
maxEntriesNoPage size (default: 1000). Continue with nextCursor; an incomplete first page also carries resourceUri for the whole list.
includeHiddenNoInclude hidden items (starting with .)
includeIgnoredNoInclude ignored items (node_modules, .git, etc).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.1
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv2.1.5
    • changedInput schema / properties / maxEntries / description
      Previous value: -"Page size (default: 1000). Continue with nextCursor; resourceUri is only for hard-cap overflow."New value: +"Page size (default: 1000). Continue with nextCursor; an incomplete first page also carries resourceUri for the whole list."
  3. Addedv2.0.0

TDQS

A3.5/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, so the description correctly does not contradict this. However, the description adds no behavioral context beyond what annotations provide—it does not mention pagination, snapshot semantics, or any side effects (which would be none given read-only). The schema itself documents cursor behavior and expiration, but the description itself adds no extra value beyond the annotation.

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 that starts with the core function and ends with a helpful pointer to an alternative. It wastes no words and is appropriately front-loaded, fitting within the ideal length for a tool this simple.

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?

The tool has 6 parameters and no output schema. The description is very brief, but the schema carries rich information (pagination, snapshot expiry, defaults, limits). For a listing tool, an agent can likely infer most behavior from the schema. However, the description does not mention that results are paginated or that deeper recursion is possible, which could be useful context. It is adequate but not comprehensive; a 3 reflects that it covers the essentials without being fully self-sufficient.

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 baseline is 3. The description does not elaborate on any parameter (e.g., path, maxDepth, includeHidden), relying entirely on the schema. It adds no additional meaning beyond what the schema already provides, so a 3 is appropriate per the rubric.

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 states a specific verb ('List') and resource ('directory's files and subdirectories') and clarifies the output format ('as a tree of names'). It also distinguishes itself from a sibling tool ('stat returns sizes and dates'), making it easy for an agent to know what this tool does and what it does not.

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?

The description gives an implicit usage guideline by noting that 'stat returns sizes and dates,' implying that stat is the tool for metadata. However, it does not explicitly state when to use this tool versus alternatives like find_files or list_roots, nor does it mention any exclusions or prerequisites. The guidance is minimal and mostly inferred.

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