Skip to main content
Glama

list_dir

Lists the contents of a single directory on your computer, providing a safer alternative to running shell ls commands.

Instructions

List one directory. Prefer this over a shell ls.

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

Input Schema

NameRequiredDescriptionDefault
PathYesAbsolute directory path.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden and largely fails to: it does not state whether the listing is recursive or single-level, whether hidden files are included, how entries are ordered, or what happens on a non-existent or permission-denied path. Beyond the verb "list" nothing about behavior is disclosed.

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?

Two short sentences, front-loaded with the core action and followed by the routing hint, with no filler. It is terse to the point of under-specification rather than verbose, so it loses a point for what it omits rather than for padding.

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?

The output schema exists, so return value explanation is not required, but for a filesystem tool with zero annotations the definition should still cover recursion depth, hidden entries, and error behavior. It is minimally viable for a one-parameter read tool and no more.

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% and the single Path parameter is already documented as an "Absolute directory path," so the description adds no meaning beyond it. With one fully documented parameter, 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?

"List one directory" states a specific verb and resource, and "one" bounds the scope (single directory, not recursive). It does not explicitly name the sibling it competes with (e.g., find_by_name or grep_search), but the shell-ls comparison gives an agent enough to identify the operation.

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 second sentence gives an explicit preference rule: use this instead of a shell ls, which routes the agent away from run_command/execute for directory listing. It lacks any when-not guidance (e.g., when to use find_by_name for recursive listing), which keeps it below a 5.

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