Skip to main content
Glama

List Directory

list_directory

Lists directory contents with per-entry type, size, mode, and modification time, supporting recursive traversal, hidden files, and entry limits for filesystem inspection.

Instructions

List directory contents with type, size, mode and mtime per entry.

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"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesdirectory path (~ is expanded)
recursiveNowalk the whole tree
max_entriesNocap on returned entries
show_hiddenNoinclude dotfiles

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations present, the description carries the full burden, and it discloses that entries include type, size, mode and mtime — useful output-shape context. However, it says nothing about behavior on a nonexistent path, permission errors, symlink handling, or result ordering, which matter for a filesystem read tool.

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?

A single front-loaded sentence with no filler; the returned-field list is the most useful content and comes first. It is arguably too terse given four parameters, but no sentence is wasted.

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

Completeness3/5

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

An output schema exists, so the description need not explain return values, and the schema covers all parameters. Still, for a filesystem read tool with no annotations, it omits error behavior and recursion semantics, leaving meaningful gaps relative to the tool's complexity.

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 100%, so all four parameters (path, recursive, max_entries, show_hidden) are already documented, including defaults and the '~ is expanded' note. The description adds no parameter meaning beyond the schema, so the baseline of 3 is appropriate.

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?

Names a specific verb and resource ('List directory contents') and enumerates the per-entry fields returned ('type, size, mode and mtime'). It is clearly distinguishable from its siblings like list_disks or list_processes, though it does not explicitly contrast with any of them.

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

Usage Guidelines2/5

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

The description gives no when-to-use guidance at all: nothing on when to pick recursive vs. flat listing, when to raise max_entries, or when a sibling tool would be more appropriate. The agent must infer usage entirely from parameter names.

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

Deploy Server

Other Tools