Skip to main content
Glama

list_dir

Lists files and subdirectories inside a specified absolute directory path, including across Local, Remote-SSH, WSL, and Dev Container VS Code workspaces.

Instructions

List the subdirectories and files inside a directory (works across Local and Remote-SSH/WSL workspaces).

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": {
      "DirectoryPath": "<DirectoryPath>"
    },
    "name": "list_dir"
  }
}

Input Schema

NameRequiredDescriptionDefault
DirectoryPathYesThe absolute path of the directory to list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the full disclosure burden. It usefully states the tool works across Local, Remote-SSH, and WSL workspaces and implies a single-level, non-recursive listing, but says nothing about hidden files, ordering, symlinks, or what happens when the path does not exist or is not a directory.

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?

One sentence, front-loaded with the core action, with the cross-workspace caveat placed in a trailing parenthetical. No filler or repetition of the tool name.

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 one-parameter read-only listing tool with a fully documented schema, the description covers the essentials and even flags multi-environment support. The only gap is that no output schema exists and the description does not say what each returned entry looks like (name, type, path), which an agent must discover at runtime.

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% and the single parameter is documented as 'The absolute path of the directory to list.' The description adds no meaning beyond that, so the baseline of 3 applies — the schema does the work here.

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?

The description pairs a specific verb ('List') with a specific resource ('subdirectories and files inside a directory'), so an agent knows exactly what the call produces. It implicitly distinguishes itself from siblings like read_file, grep_search, and find_by_name, but never names an alternative or states the boundary explicitly.

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?

Usage is only implied: you call it when you need to see what is in a directory. There is no explicit when-to-use versus when-not guidance (e.g., use find_by_name for recursive search, grep_search for content matching), leaving the agent to infer the boundary from sibling names.

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