Skip to main content
Glama

list_directory_with_sizes

List files and directories in a specified path with sizes, identifying entries using [FILE] and [DIR] prefixes. Sort results by name or size to analyze directory structure and locate specific files efficiently.

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
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 of behavioral disclosure. It usefully describes output formatting ('[FILE] and [DIR] prefixes'), access restrictions ('Only works within allowed directories'), and the inclusion of sizes. However, it doesn't mention potential limitations like pagination, error conditions for invalid paths, or performance characteristics for large directories, leaving gaps in behavioral understanding.

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 efficiently structured in three sentences: first states core functionality, second details output format, third provides usage context and restriction. Every sentence adds value with no redundancy or fluff, making it easy to parse and front-loaded with key 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?

For a tool with 2 parameters, no annotations, and no output schema, the description does well by covering purpose, output format, usage context, and restrictions. However, it lacks details on return values (beyond prefixes), error handling, and parameter specifics, leaving some gaps given the absence of structured metadata.

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 50% (only 'sortBy' has a description), so the description must compensate. It mentions the 'path' parameter ('specified path') but doesn't explain path format or validation. It implies size information in output but doesn't connect to the 'sortBy' parameter's 'size' option. The description adds some context but doesn't fully compensate for the schema's coverage gap.

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 ('Get a detailed listing') and resource ('files and directories in a specified path'), with specific output details ('including sizes', '[FILE] and [DIR] prefixes'). It distinguishes from sibling tools like 'list_directory' by specifying size inclusion and formatting, and from 'directory_tree' by focusing on flat listing rather than hierarchical structure.

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 provides clear context for when to use it ('useful for understanding directory structure and finding specific files within a directory') and includes an important exclusion ('Only works within allowed directories'). However, it doesn't explicitly compare to alternatives like 'list_directory' (which might not include sizes) or 'search_files' (for targeted searches), leaving some guidance implicit rather than explicit.

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

Related 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/Nexus-Digital-Automations/mcp-filesystem-updated'

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