Skip to main content
Glama

list_directory

List files and subdirectories in a workspace directory, with optional recursive traversal, returning each entry's name, relative path, type, and file size.

Instructions

List the contents of a directory inside the workspace.

Args: path: Directory to list, relative to the workspace root (default: the workspace root itself). recursive: If True, walk subdirectories too (capped by MCP_MAX_DIRECTORY_DEPTH).

Returns: Each entry's name, relative path, whether it's a file or directory, and file size when applicable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo.
recursiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the recursive walk is capped by MCP_MAX_DIRECTORY_DEPTH and describes return fields, which is useful. However, it doesn't mention error behavior (e.g., what if path doesn't exist), permission requirements, or whether it follows symlinks.

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 well-structured with Args and Returns sections, front-loading the purpose. Every sentence earns its place by explaining parameters and return values without redundancy.

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?

Given no output schema and 0% parameter description coverage, the description fills gaps by explaining both parameters and return fields. It is nearly complete, missing only error handling and edge cases like empty directories, but sufficient for an agent to invoke correctly.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate. It clarifies the 'path' parameter is relative to the workspace root and defaults to the root, and that 'recursive' enables subdirectory walking with a depth cap. This adds meaningful meaning beyond the bare schema, though it doesn't specify path format constraints.

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 states a specific verb (list) and resource (directory contents) with an explicit scope constraint ('inside the workspace'). It distinguishes from siblings like read_file, find_files, or get_directory_size by focusing on direct listing, though it doesn't explicitly name alternatives.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives such as find_files, get_directory_size, or directory_exists. The description implies listing but doesn't state conditions or exclusions.

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