Skip to main content
Glama

list_directory

List all files and subdirectories in a directory with details like size and modification time. Use to explore project structure and locate specific files.

Instructions

LIST AND EXPLORE directory contents. Shows all files and subdirectories with detailed information. Primary tool for directory exploration. Use for seeing what files are in a directory, exploring project structure. Keywords: list, ls, dir, show files, browse. / 列出和探索目录内容。显示所有文件和子目录的详细信息。这是目录探索的主要工具。关键词:列出、显示文件、浏览。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe directory path to list. Use '.' for current directory, '..' for parent directory, or specify any directory path. Examples: '.' (current directory), 'src/' (source directory), '/home/user/projects' (absolute path), '..' (parent directory).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYes
Behavior4/5

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

With no annotations to rely on, the description carries the burden of disclosing behavior. It states that the tool 'Shows all files and subdirectories with detailed information,' and the schema description adds that it includes names, types, sizes, and modification times. This is adequate for a read-only listing tool, though it does not mention edge cases like hidden files or symlink handling.

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?

The description is front-loaded with the core purpose and is reasonably concise. However, it includes redundant phrases ('LIST AND EXPLORE directory contents' and 'Shows all files and subdirectories with detailed information') and a full Chinese translation, which makes it slightly longer than necessary but still efficient and well-organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, clear purpose) and the presence of an output schema, the description covers all necessary context. It explains what the tool does, when to use it, and what information is returned. The sibling tools context further clarifies its role in directory exploration, making the description complete for an agent.

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?

The tool description itself does not elaborate on the path parameter, but the input schema provides comprehensive details including examples ('.', 'src/', '/home/user/projects') and a thorough description. With 100% schema coverage, the description adds no additional meaning beyond the schema, so the baseline score of 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 clearly states the tool's function with a specific verb ('LIST AND EXPLORE') and resource ('directory contents'), and explicitly says it shows all files and subdirectories with detailed information. It also identifies itself as the 'primary tool for directory exploration,' distinguishing it from sibling tools like read_file or search_files.

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

Usage Guidelines4/5

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

The description provides clear context for when to use the tool ('Use for seeing what files are in a directory, exploring project structure'). The input schema expands on this with five specific use cases, such as finding specific files and checking directory contents before operations. No exclusions are mentioned, but the guidance is sufficient for an agent to decide when to use it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shibingli/mcp-toolkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server