Skip to main content
Glama

list_directory

List directory contents in simple, detailed, tree, or JSON formats. Sort by name or size, and exclude files using glob patterns.

Instructions

List directory contents with flexible output formats. Replaces the previous list_directory, list_directory_with_sizes, and directory_tree tools. Supports simple listings, detailed views with sizes/timestamps, hierarchical tree display, and structured JSON output. Automatically filters globally configured ignored folders. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the directory to list
formatNoOutput format: 'simple' (basic listing), 'detailed' (with sizes and metadata), 'tree' (hierarchical text tree), 'json' (structured data)simple
sortByNoSort by name (alphabetical) or size (largest first)name
excludePatternsNoGlob patterns to exclude (e.g., ['*.log', 'temp*']). Applied in addition to globally configured ignored folders.
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses that globally configured ignored folders are automatically filtered and that the tool replaces previous versions, but does not mention error handling or performance characteristics.

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, each providing essential information: purpose, replacement status, format options, filtering behavior, and access restriction. No redundant or irrelevant content.

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 tool with 4 parameters, no annotations, and no output schema, the description covers purpose, formats, sort options, exclusion patterns, and access restrictions adequately. The missing output schema is acceptable since the tool returns directory listings.

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 coverage is 100%, so baseline is 3. The description adds value by explaining the format parameter variants (simple, detailed, tree, json) and clarifying that excludePatterns are applied in addition to global filters, which is not in the schema.

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 'List directory contents with flexible output formats' and specifies that it replaces three previous tools, making its purpose distinct from siblings like 'execute_shell' or 'file_operations'.

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?

The description mentions 'Only works within allowed directories' but does not provide explicit when-to-use or when-not-to-use guidance relative to alternatives like 'glob_files' or 'get_file_info'.

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/n0zer0d4y/vulcan-file-ops'

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