Skip to main content
Glama

List Directory

list_directory
Read-only

Retrieve detailed listings of files and directories in a specified path, distinguishing between them with clear prefixes to understand directory structure and locate specific files.

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
Behavior4/5

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

Annotations already declare readOnlyHint=true, indicating a safe read operation. The description adds valuable behavioral context beyond annotations by specifying the output format ([FILE] and [DIR] prefixes) and the constraint 'Only works within allowed directories,' which informs about access limitations. However, it does not mention potential errors (e.g., invalid paths) or performance aspects like pagination.

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 front-loaded with the core purpose in the first sentence, followed by additional details in a logical flow. Each sentence adds value: the first defines the action, the second specifies output format, the third explains usage context, and the fourth states a constraint. There is no redundant or wasted text.

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 the tool's moderate complexity (one parameter, read-only operation), annotations cover safety, and an output schema exists (so return values need not be explained). The description adds useful context like output formatting and access restrictions, making it mostly complete. However, it could benefit from mentioning error handling or linking to sibling tools for better integration.

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 input schema has 0% description coverage, but the description adds some meaning by specifying that the 'path' parameter is for 'a specified path' and implies it must be within allowed directories. However, it does not detail the path format (e.g., absolute vs. relative) or examples, leaving gaps in parameter understanding. With one parameter and low schema coverage, the description provides basic but incomplete compensation.

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 purpose with specific verbs ('Get a detailed listing') and resources ('files and directories in a specified path'), distinguishing it from siblings like 'directory_tree' (which might show hierarchical structure) or 'search_files' (which filters content). It explicitly mentions the output format with [FILE] and [DIR] prefixes, adding specificity.

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 this tool ('essential for understanding directory structure and finding specific files within a directory') and includes an exclusion ('Only works within allowed directories'), but it does not explicitly name alternatives like 'list_directory_with_sizes' or 'list_allowed_directories' for comparison, which would elevate it to a 5.

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/agentward-ai/agentward'

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