Skip to main content
Glama
Smart File Reader MCP Server

Smart File Reader MCP Server

get_directory_tree

Generate a formatted ASCII tree of a directory up to a specified depth, helping visualize file and folder structure for inspection and analysis.

Instructions

Generate a formatted ASCII tree structure of a directory up to max_depth.

    Args:
        directory: Directory to visualize.
        max_depth: Maximum recursion depth (default 3).
    

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_directory_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
directoryNo.
max_depthNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/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 discloses the recursion cap and that output is a formatted ASCII tree (a safe read), but says nothing about behavior on nonexistent/inaccessible paths, whether hidden files or symlinks are included, or any truncation of very large trees.

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?

The core sentence is front-loaded and wastes no words. The Args block is somewhat redundant with the schema but is compact and does reinforce the defaults.

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?

For a simple two-parameter tool with a full output schema, the description covers purpose and the depth limit adequately. Gaps remain around default handling for directory and edge-case behavior, which matter because the input schema carries no property descriptions.

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 0%, so the description must compensate, and it partially does: it restates each parameter and confirms the max_depth default of 3. However, "Directory to visualize" adds little — no guidance on absolute vs. relative paths, and it omits that directory defaults to "." even though the schema declares that default.

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 and resource ("Generate a formatted ASCII tree structure of a directory") and adds the recursion scope via max_depth, which distinguishes it from flat listings like list_files. It stops short of naming any sibling explicitly, so it lands just below the top band.

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?

Usage is only implied: an agent can infer this is the tool for visualizing nested directory structure, but there is no statement of when to prefer it over list_files or get_directory_size, and no exclusions or prerequisites.

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