Skip to main content
Glama
Raheem-19

Serena MCP Server

by Raheem-19

list_dir

List all non-gitignored files and directories in a directory, optionally recursively. Returns a JSON object with folder and file names for quick project overview.

Instructions

Lists all non-gitignored 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
recursiveYesWhether to scan subdirectories recursively.
relative_pathYesThe relative path to the directory to list; pass "." to scan the project root.
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
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses key behavioral traits: the non-gitignored filtering, optional recursion, and JSON return format. This is sufficient for a simple read-only listing tool, though it could have been even more explicit about hidden files or symlink handling. The core behavior is transparent.

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 two sentences, front-loaded with the primary action, and contains no filler. Every word adds value, defining the tool's scope, behavior, and return format concisely.

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 low complexity, the presence of an output schema, and full parameter coverage, the description is largely complete. It covers the main purpose, filtering behavior, recursion option, and return type. It could have added a note about usage versus sibling tools or hidden files, but for a straightforward listing tool, this is 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?

The input schema has 100% description coverage, so parameters are already well-documented. The description adds minimal extra meaning—it confirms the directory target and recursion option but does not go beyond what the schema already states. Baseline of 3 is appropriate when the schema does the heavy lifting.

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 lists all non-gitignored files and directories in a given directory, with optional recursion. This specific verb+resource combination distinguishes it from sibling tools like find_file (search) and read_file (read contents). The return type (JSON object) is also specified.

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 clearly implies when to use this tool: to enumerate directory contents, including the ability to recurse. It does not explicitly state when not to use it or name alternatives, but the context is clear enough for an agent to select it over searching or reading files. No exclusions are mentioned, but it earns a 4 for clear context without explicit alternatives.

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/Raheem-19/serena-optimized'

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