Skip to main content
Glama

List files

list_files
Read-only

List workspace files and directories by path, with optional glob and depth filters. Use to discover what exists before reading or editing; directories show '/', skips .git, node_modules, .cache.

Instructions

List files and directories inside the workspace, sorted by workspace-relative path. Directories are marked with a trailing '/'. Use this to discover what exists before reading or editing, optionally filtered with a glob pattern. Skips the .git, node_modules and .cache directories and does not follow symbolic links. Do not use it to read content (use read_file) or to search text (use grep).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory to list, workspace-relative. Defaults to the workspace root.
limitNoMaximum number of entries to return. Defaults to 500 and is capped at 5000.
patternNoGlob filter such as '*.ts', 'src/**' or '**/*.{js,json}'. Patterns without a slash match the name at any depth. Defaults to all entries.
maxDepthNoMaximum directory depth to descend. Defaults to 6 and is capped at 12.
workspaceNoWorkspace name (see workspace_list). Defaults to the primary workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds valuable behavioral context beyond that: it skips .git, node_modules, and .cache, does not follow symbolic links, and sorts by workspace-relative path. It does not detail the exact output format beyond the trailing slash marker, but that is a minor gap given the annotations.

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 three sentences with zero waste. The core behavior and output format are front-loaded, followed by usage guidance and exclusions. Every sentence earns its place.

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 read-only listing tool with 100% schema coverage and no output schema, the description is nearly complete. It covers purpose, exclusions, symlink behavior, and routing to siblings. The only minor gap is that it doesn't describe the exact return structure beyond the trailing slash marker, but that is not essential for an agent to call it correctly.

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 schema already documents all five parameters. The description adds a little extra meaning by explaining the glob pattern semantics ('Patterns without a slash match the name at any depth') and the default/cap behavior, but most parameter meaning is already in the schema. Baseline 3 is appropriate.

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'), a resource ('files and directories inside the workspace'), and a distinguishing behavior (sorted by workspace-relative path, directories marked with trailing '/'). It also explicitly contrasts with siblings read_file and grep, so an agent can tell it apart without opening schemas.

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

Usage Guidelines5/5

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

The description explicitly says when to use this tool ('to discover what exists before reading or editing') and when not to use it ('Do not use it to read content (use read_file) or to search text (use grep)'). It also mentions optional glob filtering, giving clear context for selection.

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