Skip to main content
Glama
modelcontextprotocol

Filesystem MCP Server

Official

List Directory with Sizes

list_directory_with_sizes
Read-only

List files and directories in a specified path with their sizes, sorted by name or size. [FILE] and [DIR] prefixes clearly distinguish file types.

Instructions

Get a detailed listing of all files and directories in a specified path, including sizes. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is useful for understanding directory structure and finding specific files within a directory. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
sortByNoSort entries by name or sizename

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
Behavior3/5

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

Annotations already indicate readOnlyHint=true and openWorldHint=false. The description adds that results use [FILE] and [DIR] prefixes and include sizes, which is useful behavioral context, but does not mention sorting behavior or performance implications. Moderate value added beyond annotations.

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, directly addressing purpose, output format, utility, and a key constraint. No unnecessary words, well-structured and efficient.

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 that an output schema exists, it's appropriate not to detail return values. The description covers output format (prefixes), purpose, and scope. It mentions nothing about the sortBy parameter, but the overall information is sufficient for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only 50% of parameters have schema descriptions (sortBy is described, path is not). The description only says 'specified path' without adding format, restrictions, or examples for the path parameter, offering minimal help beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states it lists files/directories with sizes and distinguishes with prefixes, making the purpose clear. However, it does not explicitly differentiate from sibling tool 'list_directory', which may only list names without sizes, but the distinction is implied.

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 says it's useful for understanding structure and finding files, and mentions the allowed-directories constraint. It does not provide explicit guidance on when to use this tool versus siblings like 'directory_tree' or 'list_directory', leaving the agent to infer context.

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/modelcontextprotocol/filesystem'

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