Skip to main content
Glama
drewster99

xcode-mcp-server (drewster99)

by drewster99

get_directory_tree

Read-onlyIdempotent

Display a visual directory tree showing only folders, with adjustable depth. For Xcode projects, accepts .xcodeproj or .xcworkspace paths to show project root structure.

Instructions

Get a visual tree of directories (folders only) in the specified path.

Shows the folder structure as a tree diagram with box-drawing characters. Does not include individual files - use get_directory_listing for file details.

Special behavior: If directory_path ends with .xcodeproj or .xcworkspace, the tree will show the parent directory structure (since these are typically at the root of a project folder).

Args: directory_path: Path to directory to scan. Can also be a .xcodeproj or .xcworkspace path (will scan parent directory in that case). max_depth: Maximum recursion depth (default 4, prevents excessive output). Depth 1 = immediate subdirectories only, Depth 4 = up to 4 levels deep.

Returns: A visual tree representation showing only directories/folders, with a note about using get_directory_listing for file-level details.

Example:
/Users/you/Projects/MyApp/
├── Sources/
│   ├── Models/
│   └── Views/
├── Tests/
└── Resources/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directory_pathYes
max_depthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare the tool as read-only, idempotent, and non-destructive. The description adds valuable behavioral context: the output format (tree diagram with box-drawing characters), the special handling of project files, and the default max_depth of 4 to prevent excessive output.

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 description is well-structured and front-loaded with the core purpose. It is slightly verbose with repetition about get_directory_listing, but every sentence adds value. Could be trimmed slightly, but overall efficient.

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 simple nature of the tool and good annotations, the description covers the purpose, parameters, special behavior, and return format. It lacks information about error handling (e.g., invalid paths), but for a read-only tool this is acceptable.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden. It fully explains both parameters: directory_path (including the .xcodeproj/.xcworkspace special case) and max_depth (default 4, with clear explanation of depth levels). No additional schema documentation is needed.

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 'Get a visual tree of directories (folders only) in the specified path,' which is a specific verb+resource combination. It also distinguishes itself from the sibling tool get_directory_listing by explicitly noting that it does not include files.

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

Usage Guidelines5/5

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

The description explicitly tells when to use this tool (to see folder structure) and when to use an alternative: 'Does not include individual files - use get_directory_listing for file details.' It also explains special behavior for .xcodeproj/.xcworkspace paths.

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/drewster99/xcode-mcp-server'

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