Skip to main content
Glama

List Directory

list_directory
Read-only

List all files and directories in a specified path, with clear [FILE] and [DIR] prefixes to reveal directory structure and locate specific items within allowed paths.

Instructions

Get a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint=true, openWorldHint=false), so the bar is lower; the description still adds two genuinely useful traits: the output tagging convention ([FILE]/[DIR] prefixes) and the sandbox constraint that it only works inside allowed directories. It omits whether traversal is recursive or paginated, which is the main behavioral question left open.

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?

Front-loaded with the core behavior and the output format detail. The sentence 'This tool is essential for understanding directory structure...' is mildly promotional filler, but the rest is dense and earns its place.

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?

An output schema exists, so return-value documentation is not strictly required, and the sandbox note plus prefix convention cover the essentials. What is missing is the recursion/scope boundary in a sibling set that contains directory_tree and list_directory_with_sizes, which is the one thing an agent must know to avoid picking the wrong listing tool.

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 0% for the single 'path' parameter, so the schema alone says nothing. The description partially compensates by indicating the path is a directory location constrained to allowed directories, but it gives no format, relative-vs-absolute, or symlink semantics.

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?

States a specific verb and resource ('Get a detailed listing of all files and directories') plus the input scope ('in a specified path'), which is enough for an agent to know what the tool returns. However, it never distinguishes itself from close siblings like list_directory_with_sizes or directory_tree, so the agent must infer that this is the plain, non-recursive, size-free variant.

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?

'Essential for understanding directory structure and finding specific files' implies the use case but names no alternative and gives no when-not guidance. The one explicit scoping rule ('Only works within allowed directories') is a prerequisite rather than usage routing, and it does not tell the agent when to prefer list_directory_with_sizes, directory_tree, or search_files.

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