Skip to main content
Glama

List Dir

list_dir
Read-only

Browse and retrieve file and directory listings from a specified path, with options for recursive scanning and filtering ignored files.

Instructions

Lists files and directories in the given directory (optionally with recursion). Returns a JSON object with the names of directories and files within the given directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relative_pathYesThe relative path to the directory to list; pass "." to scan the project root.
recursiveYesWhether to scan subdirectories recursively.
skip_ignored_filesNoWhether to skip files and directories that are ignored.
max_answer_charsNoIf the output is longer than this number of characters, no content will be returned. -1 means the default value from the config will be used. Don't adjust unless there is really no other way to get the content required for the task.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, establishing this as a safe read operation. The description adds useful behavioral context about recursion capability and the JSON return format, but doesn't mention potential limitations like performance implications of recursion, permission requirements, or rate limits. No contradiction with annotations exists.

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 efficiently structured in two sentences that convey the core functionality and return format. It's appropriately sized for the tool's complexity, though it could be slightly more front-loaded by mentioning recursion earlier. No wasted words or redundant information.

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 existence of both comprehensive annotations (readOnlyHint, destructiveHint) and an output schema (implied by 'Has output schema: true'), the description provides adequate context. It covers the basic operation, recursion capability, and return format, though it could benefit from mentioning performance considerations or common use cases relative to sibling tools.

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?

With 100% schema description coverage, all parameters are already well-documented in the input schema. The description mentions recursion but doesn't add meaningful semantic context beyond what the schema provides about parameters. The baseline score of 3 is appropriate when the schema carries the full parameter documentation burden.

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 specific action ('Lists files and directories'), identifies the target resource ('in the given directory'), and distinguishes from siblings by specifying the exact scope of listing operations. It explicitly mentions optional recursion, which differentiates it from simpler directory listing tools.

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 implies usage context through 'optionally with recursion' and mentions what the tool returns, but provides no explicit guidance on when to use this tool versus alternatives like 'find_file' or 'search_for_pattern' among the sibling tools. No when-not-to-use scenarios or prerequisites are mentioned.

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/chrisgreenx-ctrl/serena'

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