Skip to main content
Glama

tree_to_txt

Turn any directory into a text file showing its full tree structure. Maps project hierarchies, aids documentation, and automatically excludes .venv, pycache, .git, and gitignored files.

Instructions

扫描指定目录(默认为当前目录)生成完整目录文件树,保存到文本文件中。适用于:项目结构概览、文档编写、了解目录层级关系。参数: -d <目录路径> 指定扫描目录(默认当前目录);-o <文件名> 指定输出文件(默认 file_tree.txt)。自动跳过 .venv、pycache、.git 目录及 .gitignore 中忽略的内容。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals key behaviors: automatic skipping of .venv, __pycache__, .git directories and content ignored by .gitignore. It also specifies defaults for the directory and output filename. This is valuable context beyond what the schema provides. It doesn't mention overwrite behavior or console output, but the core behaviors are well-covered.

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?

The description is efficiently structured: a main sentence about the function, a list of use cases, parameter explanations, and exclusion behaviors. Every sentence adds value, and the primary purpose is front-loaded. No unnecessary fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description is remarkably complete. It covers purpose, parameters and defaults, behavior (skipping directories), and use cases. The tool is simple (a single string argument), and the description fully equips an agent to invoke it correctly. The only minor omission is lack of explicit mention of what the output file content looks like beyond 'complete directory file tree', but this is implied.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has only one 'args' string parameter with no description (0% coverage). The description compensates by explaining the two command-line style parameters (-d for directory, -o for output file) and their defaults. It does not explicitly state that these flags should be passed as a single string in the 'args' field, but the implication is clear from the description. This adds significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: scanning a specified directory (default current) to generate a complete directory file tree and save it to a text file. It uses a specific verb ('scans', 'generates', 'saves') and resource (directory tree), effectively distinguishing it from sibling tools like xlsx_to_txt and text_to_txt which deal with file conversions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly lists use cases: '适用于:项目结构概览、文档编写、了解目录层级关系' (suitable for project structure overview, documentation writing, understanding directory hierarchy). It provides clear context for when to use the tool, though it does not mention alternatives or explicitly state when not to use it. Given the distinct purpose, this is sufficient.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Liangbiaoyong/Python_Scripts_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server