Skip to main content
Glama

List Directory with Sizes

list_directory_with_sizes
Read-onlyIdempotent

List files and directories in a path with each entry's size and [FILE] or [DIR] marker, sorted by name or largest-first, plus totals. Use when file sizes matter, like finding the biggest files.

Instructions

List the files and directories directly inside a path with each file's size, marked [FILE] or [DIR], sorted by name or by size, largest first (sortBy). Use it when sizes matter, such as finding the largest files; for names only, use list_directory, which returns less text. Returns one line per entry, followed by the totals. Only works within allowed directories.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "list_directory_with_sizes"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesThe directory to list. Absolute, or relative to an allowed directory; it must resolve inside the allowed directories.
sortByNoSort entries by name or sizename

Output Schema

NameRequiredDescriptionDefault
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the bar is lower. The description still adds real context the annotations don't: the line-per-entry output shape followed by totals, and the hard constraint that it 'Only works within allowed directories' — a meaningful access boundary an agent must know before calling.

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?

Three dense sentences with the capability front-loaded, then the alternative, then the output shape and the scope limit. Nothing is padding, though the parenthetical '(sortBy)' and the scope sentence could be folded more tightly.

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

Completeness5/5

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

For a two-parameter read tool with an output schema and full annotation coverage, everything an agent needs is present: selection criteria, sort semantics, output shape sketch, and the allowed-directory boundary. No important calling decision is left to inference.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema lacks: size sorting is 'largest first', whereas the schema only says 'Sort entries by name or size'. That ordering detail changes how an agent should interpret the top result.

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 opens with a specific verb+resource ('List the files and directories directly inside a path') and immediately adds distinguishing detail — per-entry size, [FILE]/[DIR] markers, and sort order. It explicitly separates itself from list_directory, so an agent can choose between them without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the selection condition ('Use it when sizes matter, such as finding the largest files') and names the alternative with the reason to prefer it ('for names only, use list_directory, which returns less text'). Both the when and the when-not are explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.