Skip to main content
Glama
GeminiDesk MCP
by LZ7TOP

Get Directory Tree

fs_tree

Generates a project directory tree view, skipping node_modules, .git, and build folders by default, so AI agents can grasp code structure with one call.

Instructions

快速生成项目目录树视图(自动跳过 node_modules、.git、dist 等构建目录),方便 AI 一键把握代码结构。

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_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes目标根目录路径
maxDepthNo最大展开深度
maxNodesNo最大节点数
excludeDirsNo额外排除的目录名
includeHiddenNo是否包含隐藏文件

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full disclosure burden, and it does add real behavioral value by stating that node_modules, .git and dist are skipped automatically. It is silent on other important traits: output format, what happens when maxNodes is hit (truncation vs error), symlink handling, and read-only confirmation.

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?

It is a single compact sentence that front-loads the action and parenthetically states the key behavior, with no filler. It could still be slightly tighter, or it could add one clause about output shape without hurting readability.

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 schema is fully described and the tool is moderately simple, yet the description leaves the agent unsure what the return value looks like (a text tree, a nested object, or a path list) and whether output is truncated at maxNodes. It does state the default exclusions, which is the main thing the schema cannot convey.

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%, so the schema already documents all five parameters, which sets the baseline at 3. The description contributes one detail the schema omits: the built-in default excluded directories, which helps the agent understand how excludeDirs actually behaves. It adds nothing about maxDepth or maxNodes semantics.

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: generate a project directory tree view. It also conveys the scope — a whole-tree overview for grasping code structure — which sets it apart from a flat listing tool such as fs_list_directory. It does not explicitly name any sibling, so it falls 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?

The phrase "方便 AI 一键把握代码结构" implies the intended use (getting a structural overview of a codebase) but never says when to prefer fs_tree over fs_list_directory or fs_search, and gives no exclusions or prerequisites. Usage is implied rather than specified.

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