Skip to main content
Glama
GeminiDesk MCP
by LZ7TOP

List Directory

fs_list_directory

Lists folders and files in a specified directory with sizes, types, and permissions. Use it to inspect directory contents recursively with depth and entry limits.

Instructions

读取并列出指定目录中的文件夹与文件列表,包含大小、类型和权限信息。

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": "fs_list_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes目标目录路径(支持绝对路径、相对路径或 ~)
maxDepthNo递归最大深度
recursiveNo是否递归列出子目录
maxEntriesNo最大返回条目数
includeHiddenNo是否包含以 . 开头的隐藏文件

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It usefully discloses what is returned (names plus size, type and permission metadata) and thereby partially substitutes for the missing output schema, but it says nothing about symlink handling, permission-denied errors, truncation when maxEntries is hit, or how deep recursion behaves.

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, and the returned-field list is appended efficiently. It is arguably too terse for a five-parameter tool, but nothing is wasted or buried.

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 tool has five parameters, no annotations and no output schema, so the description must do more than one sentence. It covers the return payload but leaves recursion semantics, hidden-file default, and result truncation undocumented, which are exactly the behaviors an agent needs when choosing between a flat and recursive listing.

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 100%, so path, maxDepth, recursive, maxEntries and includeHidden are all documented in the schema itself. The description adds no parameter-specific meaning (no default behavior for hidden files, no note about the depth cap interacting with recursive), 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 states a specific verb (读取并列出 / read and list) and resource (指定目录 / the specified directory) and even names the returned fields (size, type, permissions), so the operation is unambiguous. It does not distinguish itself from the recursive-tree sibling fs_tree or from fs_search, which matters given this tool itself exposes recursive/maxDepth parameters.

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?

There is no explicit when-to-use or when-not-to-use guidance, and no alternative is named. The only usage signal is implicit from 'list the specified directory', leaving the agent to guess how it differs from fs_tree or fs_search when recursion is desired.

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