Skip to main content
Glama
lin2000wl

Serena MCP Server

by lin2000wl

list_dir

Lists files and directories in a specified path, excluding gitignored items, with optional recursive scanning to view project structure.

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
relative_pathYesThe relative path to the directory to list; pass "." to scan the project root.
recursiveYesWhether to scan subdirectories recursively.
max_answer_charsNoIf the output is longer than this number of characters, no content will be returned. Don't adjust unless there is really no other way to get the content required for the task.
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it filters out gitignored files, returns JSON structure with directory/file names, and mentions recursion. However, it doesn't address important aspects like performance implications of recursion, error handling for invalid paths, or what happens when max_answer_chars is exceeded.

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: the first states the core functionality, the second describes the return format. It's appropriately sized for the tool's complexity, though it could be slightly more front-loaded by mentioning the JSON return earlier.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only directory listing tool with no output schema, the description provides adequate but incomplete context. It covers what the tool does and the return format, but lacks information about error conditions, performance characteristics, and the practical implications of the max_answer_chars parameter. The absence of annotations increases the need for more behavioral disclosure.

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 description coverage is 100%, providing solid documentation for all parameters. The description adds minimal value beyond the schema - it mentions recursion but doesn't elaborate on its effects, and doesn't explain the interaction between parameters. The 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 verb ('Lists'), resource ('all non-gitignored files and directories'), and scope ('in the given directory'). It distinguishes itself from siblings like 'find_file' by focusing on directory listing rather than searching, and from 'read_file' by returning metadata rather than content.

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 through its functional description but doesn't explicitly state when to use this tool versus alternatives like 'find_file' or 'search_for_pattern'. It mentions recursion as an option but doesn't provide guidance on when to enable it versus using other tools for deeper searches.

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/lin2000wl/Serena-cursor-mcp'

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