Skip to main content
Glama
modelcontextprotocol

Filesystem MCP Server

Official

Directory Tree

directory_tree
Read-only

Retrieve a recursive tree view of files and directories as JSON. Each entry shows name, type, and children for 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
excludePatternsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
Behavior5/5

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

Adds details beyond readOnlyHint: output format (2-space indentation), children array behavior, and allowed directory restriction. No contradictions with annotations.

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?

Four sentences, each adding value. Front-loaded with purpose, then details on output fields, children behavior, and formatting. No redundancy.

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?

Adequately covers output fields and safety (readOnly, allowed directories). Minor gap: no mention of potential performance with large directories or error handling. With output schema present, return values are covered.

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

Parameters2/5

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

With 0% schema description coverage, the description should explain parameters but does not. 'path' and 'excludePatterns' are not described, leaving their meaning implicit.

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 it retrieves a recursive tree view of files and directories as JSON. It specifies the output structure ('name', 'type', 'children') and distinguishes from flat list siblings like list_directory.

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?

Implies use when a hierarchical view is needed, but does not explicitly state when not to use or compare to alternatives. The restriction to allowed directories is noted.

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/modelcontextprotocol/filesystem'

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