Skip to main content
Glama

fs_list_directory

Read-onlyIdempotent

Lists files and directories in the sandbox workspace root with bounded depth traversal, optional hidden-file inclusion, and protection flags for sensitive credentials.

Instructions

List files and directories inside the sandbox workspace root using bounded iterative BFS traversal. Sensitive credential files are flagged as 'protected_sensitive'.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "fs_list_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoRelative directory path inside the workspace root..
max_depthNoMaximum directory traversal depth (1 to 10).
include_hiddenNoWhether to include dotfiles (sensitive files remain masked as protected).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world scope, so the safety profile is covered. The description still adds real context beyond them: traversal is bounded BFS, and sensitive credential files are surfaced with a 'protected_sensitive' marker rather than omitted. It stops short of describing result ordering, truncation at the workspace boundary, or whether symlinks are followed.

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 short sentences with zero filler; the scope and traversal model come first and the protected-file behavior second. Every clause carries information an agent needs.

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 read-only listing tool with complete annotations and full schema coverage, the definition is nearly sufficient, and it helpfully flags the protected_sensitive output marker. With no output schema, it could still say what each entry looks like (name, path, type) and whether results are flat or nested.

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 schema already documents path, max_depth (1-10) and include_hidden including the note about sensitive files remaining masked. The description adds the BFS traversal model, which slightly clarifies what max_depth controls, but does not otherwise extend parameter meaning, so the baseline 3 applies.

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 gives a specific verb and resource ('List files and directories') and scopes it to 'the sandbox workspace root', which separates it from siblings like fs_read_file or fs_write_file by implication. It never explicitly contrasts itself with a search tool such as fs_search_text, so an agent must infer that listing is structural rather than content-based.

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: 'inside the sandbox workspace root' and the 'bounded iterative BFS traversal' phrasing suggest exploratory browsing, but there is no statement of when to pick this over fs_search_text or fs_read_file. No prerequisites or exclusions are given.

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