Skip to main content
Glama

list_directory

Read-only

List directory contents, showing file type, size, and child count. Support recursion and hidden file inclusion to navigate large codebases and data files.

Instructions

List the contents of a directory.

Each entry has a type field: 'dir' for directories, 'file' for files.
Use max_depth > 1 to recurse into subdirectories. Automatically ignores
__pycache__, node_modules, and .git. Returns entry type, size in bytes,
and child count for directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
absolute_dir_pathYesThe absolute path to the directory to list.
max_depthNoHow many levels deep to recurse (default: 1 = direct children only).
max_entriesNoMaximum total entries to return. Defaults to server config (200).
include_hiddenNoInclude entries starting with '.' (default: false).
Behavior4/5

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

Beyond annotations (readOnly=true), description adds important behaviors: automatic ignoring of common directories, return structure (type, size, child count). No contradictions.

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 concise sentences, front-loaded purpose, no redundancy. Every sentence adds value.

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?

Describes return format (type, size, child count) despite no output schema. Mentions ignored directories. Lacks mention of ordering or potential performance issues with deep recursion, but otherwise sufficient.

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 descriptions already cover all 4 parameters (100% coverage). Description repeats max_depth usage but adds no new semantics beyond schema, so baseline 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?

Clearly states it lists directory contents, distinguishes from sibling tools like read_content or edit_content. Mentions type field, recursion, ignored directories, and return fields.

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 on when to use list_directory vs search_directory or other siblings. Only usage hints about max_depth recursion, no context on prerequisites or when to avoid.

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/peteretelej/largefile'

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