Skip to main content
Glama

List a folder

list_directory
Read-only

List files and folders in a directory. Pass recursive:true to walk subdirectories (default depth 3, max 10, capped at 2000 entries).

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
deviceNoDevice name. Optional when the account has only one online device.
max_depthNoHow many levels deep when recursive is true. Default 3, max 10.
recursiveNoWalk subdirectories. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / max_depth
      Added value: +{
      +  "description": "How many levels deep when recursive is true. Default 3, max 10.",
      +  "type": "number"
      +}
    • addedInput schema / properties / recursive
      Added value: +{
      +  "description": "Walk subdirectories. Default false.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare this a safe read (readOnlyHint=true, destructiveHint=false, openWorldHint=false), so the safety burden is covered. The description earns credit by disclosing real operational constraints the agent could not otherwise predict: a default depth of 3, a hard max of 10, and a 2000-entry result cap. It does not say what happens when the cap is hit (truncation vs error).

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?

Two tight sentences with zero filler. The core action comes first and the recursive/depth constraints follow in a single parenthetical, so an agent can skim the first clause and still act correctly.

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 4-parameter read-only listing tool with no output schema, most of what an agent needs is present, and the annotations carry the safety profile. Gaps remain: the description never says what an entry looks like in the response, how truncation at 2000 entries is signaled, or how the optional device parameter affects resolution.

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 75%, so the schema already documents max_depth and recursive with the same defaults the description repeats. The only genuinely new information is the 2000-entry cap, which is not a parameter behavior. The device parameter is never addressed in the description, leaving one parameter documented only by its schema line.

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 folders in a directory.' An agent can immediately tell this is a directory enumeration tool. It does not name any sibling (e.g. search_files) to disambiguate, so it stops short of a 5.

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: given a path, enumerate its contents. There is no statement of when to prefer this over search_files, or when not to use it, and no prerequisites mentioned beyond the schema's device note. The recursive hint is the only steering signal.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources