Skip to main content
Glama

directory_tree

Generate a hierarchical tree view of files and directories in JSON format. Each entry includes 'name', 'type' (file/directory), and 'children' for directories, providing a structured overview of the specified path within allowed directories.

Instructions

Get a recursive tree view of files and directories as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
Behavior3/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 adds useful context: the output format (JSON with 2-space indentation), structure details (entries include 'name', 'type', 'children'), and the constraint ('Only works within allowed directories'). However, it doesn't cover aspects like error handling, performance implications for large directories, or authentication needs.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by details on output structure and constraints. Every sentence adds value without redundancy, making it efficient and easy to parse.

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?

Given the tool's moderate complexity (recursive tree generation), no annotations, and no output schema, the description does well by explaining the output format and structure in detail. It covers key aspects like entry fields and the 'children' array behavior. However, it could improve by mentioning potential limitations (e.g., depth limits) or error cases.

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?

Schema description coverage is 0%, so the description must compensate for the single parameter 'path'. While it doesn't explicitly mention the 'path' parameter, the context 'Get a recursive tree view' and 'Only works within allowed directories' implies that a path is required to specify the starting directory. This adds meaningful semantics beyond the bare schema, though it could be more direct.

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 purpose with specific verbs ('Get a recursive tree view') and resources ('files and directories'), distinguishing it from siblings like 'list_directory' (flat listing) or 'get_file_info' (single file). It precisely defines what the tool does: returns a JSON structure representing a directory tree.

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 provides clear context for usage with 'Only works within allowed directories,' indicating a constraint, and implicitly distinguishes it from siblings by specifying a recursive tree view (vs. flat listings in 'list_directory' tools). However, it lacks explicit when-not-to-use guidance or named alternatives for similar tasks.

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

Related 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/Nexus-Digital-Automations/mcp-filesystem-updated'

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