Skip to main content
Glama
modelcontextprotocol

Filesystem MCP Server

Official

List Directory with Sizes

list_directory_with_sizes
Read-only

List files and directories with sizes, using [FILE] and [DIR] prefixes for clarity; sort by name or size to efficiently locate files.

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
Behavior4/5

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

Annotations indicate readOnlyHint=true, and the description confirms read-only behavior by describing a listing operation. It adds value by disclosing the output format (prefixes) and the allowed directories constraint, which annotations do not cover.

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 adding value. The first sentence states purpose, the second adds output format detail, the third provides usage context and constraint. No wasted words.

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?

The tool has an output schema, so return values are separately documented. The description covers path, sorting, output format, and allowed directories constraint. 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 provides descriptions for sortBy (enum) but not for path. The description mentions 'specified path' and 'including sizes', which loosely relate to parameters but does not add explicit detail beyond the schema. Schema coverage is 50%, so description partially compensates.

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 it lists files and directories in a path with sizes, and distinguishes entries with [FILE] and [DIR] prefixes. This differentiates it from sibling tools like list_directory, which likely lacks size information.

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 directory structure and finding files, but does not explicitly state when to use this tool over list_directory or other siblings. The constraint 'Only works within allowed directories' is noted but no guidance on when not to use.

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