Skip to main content
Glama

List directory

ls
Read-only

List directory contents with names, sizes, permissions, and modification times; include hidden files, names only, or one-level subdirectories as needed.

Instructions

List files in a directory. Returns entries as [name, size, permissions, modified] — directories end with '/' and links with '@'. Use nameOnly for names alone, recursive for one level of subdirectories, all to include hidden files.

Input Schema

NameRequiredDescriptionDefault
allNoInclude hidden files
pathNoRequired. Directory path to list
nameOnlyNoEntries are [name] alone
recursiveNoRecurse into subdirectories (1 level)

Output Schema

NameRequiredDescriptionDefault
entriesYes
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A3.8/5.0
Behavior4/5

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

readOnlyHint=true already covers the safety profile, and the description adds genuinely non-obvious traits: entry tuple ordering [name, size, permissions, modified], directory entries suffixed with '/', links with '@', and that recursion is only one level deep. It does not mention path errors or performance on large directories, keeping it from a 5.

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?

Two sentences, zero waste. The core action and return format come first, then flag semantics — properly front-loaded and appropriately sized.

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?

An output schema exists so return values needn't be spelled out, and the description still covers the notable formatting quirks plus the recursion limit. Minor gaps around relative vs absolute paths or behavior on invalid paths are the only shortfall.

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 coverage is 100%, so all four parameters are already documented, and the description largely restates them (all=hidden files, nameOnly=names alone). The 'one level' emphasis on recursive is a mild addition, so baseline 3 is right.

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?

States a specific verb and resource ('List files in a directory') and describes the return shape, so the agent knows exactly what it gets. It never distinguishes itself from siblings like tree, find_files, glob, or du, which also enumerate filesystem content, so it falls short of a 5.

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 flag explanations ('Use nameOnly for names alone, recursive for one level of subdirectories, all to include hidden files') imply when to set each option, but there is no explicit guidance on when to choose this over tree/find_files/glob. Usage is inferable rather than stated.

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