Skip to main content
Glama

list_dir

Lists files and subdirectories in an allowed local directory, with an optional entry limit, to inspect folder contents and verify paths before further actions.

Instructions

List files and subdirectories in an allowed local directory.

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

Input Schema

NameRequiredDescriptionDefault
dirPathYesAbsolute directory path
maxEntriesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does not say whether listing is recursive, whether hidden entries are included, what order results come in, what happens when maxEntries truncates output, or what an "allowed directory" rejection looks like — all critical for a filesystem read.

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. It is efficient, though its brevity is part of why behavioral and usage details are missing.

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

Completeness2/5

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

With no annotations, no output schema, and an undocumented maxEntries parameter, the definition leaves too much unspecified. An agent cannot tell whether results are truncated, recursive, or ordered, which matters for a 2-parameter filesystem tool.

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 50%: dirPath is documented as "Absolute directory path," but maxEntries has no description, only a default of 100 and bounds 1-300. The description adds no meaning beyond the schema for either parameter, so it neither compensates for the gap nor drops below the schema-coverage baseline.

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 and subdirectories." An agent can tell it is a directory-listing read, distinct in kind from siblings like find_files or batch_read, though the description never names an alternative explicitly.

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 only guidance is the phrase "in an allowed local directory," which is a sandbox constraint rather than a when-to-use rule. There is no statement about when to prefer this over find_files or other listing/search siblings, and no exclusions.

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