Skip to main content
Glama

List Directory

list_directory
Read-only

Lists files and folders in an approved workspace path, returning each item's name, type, and size in bytes.

Instructions

List files and folders within an approved workspace path. Returns filename, type (file/dir), and size in bytes.

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
pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

readOnlyHint=true already declares the safety profile, so the description's main added value is the 'approved workspace path' constraint, which tells the agent access is scoped. It does not mention recursion, depth limits, hidden files, or error behavior for non-existent/unapproved paths, so behavioral disclosure beyond annotations is thin.

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, with the operation and scope front-loaded and no filler. The return-field sentence is largely redundant given an output schema exists, which keeps it from a 5.

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?

With an output schema present, return values did not need describing, and annotations cover the read-only nature; what remains missing is path format/validation guidance and listing behavior (recursion, limits). For a simple one-parameter tool this is close to sufficient but not complete.

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 0% for the single 'path' parameter, so the description must carry semantics; it partially does by indicating the path must be an approved workspace path. It still omits format expectations (absolute vs relative, workspace root, symlink handling), so the gap is only partly closed.

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 uses a specific verb and resource ('List files and folders') and scopes it to 'an approved workspace path', which clearly separates it from siblings like list_backups or list_open_windows that list entirely different resources. It stops short of naming any sibling or stating explicit differentiation, so it is clear but not maximally distinctive.

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 by the resource being listed; the 'approved workspace path' phrase hints at a sandboxing constraint but there is no statement of when to choose this over another listing tool, nor any exclusion. Adequate for an obvious tool, but no explicit routing guidance.

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