Skip to main content
Glama

list_directory

List directory contents with file names, types, and sizes to inspect project structure or locate specific files within allowed paths.

Instructions

Lists the contents of a directory: file/directory names, types, and sizes.
Path must be within allowed roots (~/Projects, ~/Documents).

Use this when investigating directory contents, checking project structure,
or looking for specific files. Does not modify system state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations present, the description carries the full burden. It discloses that it does not modify system state and restricts the path to allowed roots, which are essential behavioral constraints. It does not detail error handling or response format, but for a simple listing tool, the provided disclosures are adequate.

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?

Three sentences with no redundancy. The primary purpose is front-loaded in the first sentence, followed by constraints and usage guidance. Every sentence contributes value without excess.

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?

For a single-parameter tool with an output schema (even though not shown), the description explains what is returned (names, types, sizes) and the key constraint (allowed roots). It is complete for an agent to correctly select and invoke the tool. No critical missing information.

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 description coverage is 0%, so the description must compensate. It does by explaining the allowed path values ('within allowed roots (~/Projects, ~/Documents)'), which is meaningful beyond the bare schema property 'path'. It doesn't specify absolute vs relative paths, but the root restriction is a key semantic.

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 verb 'Lists' the resource 'contents of a directory' and specifies the output includes file/directory names, types, and sizes. It is distinct from sibling tools like get_file_metadata, search_files, and read_file, even without naming them explicitly.

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?

It explicitly says 'Use this when investigating directory contents, checking project structure, or looking for specific files,' giving clear context for when to invoke it. It also notes 'Does not modify system state,' implying it's safe for read-only exploration. However, it does not explicitly mention when not to use it or point to alternatives for other scenarios.

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/Ronit-k/MCPilot'

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