Skip to main content
Glama

Get project tree

get_tree
Read-onlyIdempotent

Retrieve an effective project tree after applying gitignore, built-in, profile, and optional glob filters. Format it as Markdown, JSON, XML, or text for a clear codebase overview.

Instructions

Return the effective project tree after built-in, gitignore, profile, and optional agent glob filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoOptional Git branch for a remote project URL; invalid for local project paths.
formatNoTree representation. Markdown is the compact default; text uses drawing characters, while JSON and XML are structured.markdown
projectNoAbsolute root path returned by list_projects, or a Git URL when the server allows remote sources. Optional only when one local root is configured.
git_scopeNoFurther restrict results to staged files, all current changes, or files changed between two Git refs.
max_depthNoMaximum tree depth from 0 to 1000; accepts an integer or numeric string.
tracked_onlyNoRestrict results to files tracked by Git; accepts a boolean or the string 'true' or 'false'.
max_file_bytesNoExclude otherwise selected files strictly larger than this byte count; integer or numeric string.
exclude_patternsNoProject-relative glob patterns using '/' to exclude additional paths.
include_patternsNoProject-relative glob patterns using '/'. They only narrow built-in and gitignore filtering.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, so the bar is lower. The description adds valuable context by disclosing that output is the 'effective' tree after built-in, gitignore, profile, and optional glob filters, which is not inferable from annotations alone. It is consistent 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?

A single sentence, front-loaded with the core action and resource, then the filter stages. No filler or repetition of schema content.

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?

For a high-complexity tool with 9 optional parameters, the description gives enough high-level context (effective tree, filter pipeline) while leaving per-parameter details to the complete schema. It doesn't address all edge cases like project resolution or remote sources, but schema coverage and annotations cover most operational constraints; the lack of an output schema is partially mitigated by the strong parameter documentation.

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 100%, so the schema documents every parameter. The description's mention of 'optional agent glob filters' adds a conceptual frame for include_patterns and exclude_patterns, but it doesn't detail individual parameters; baseline 3 is appropriate.

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 (Return) and resource (effective project tree), and explains the filtering pipeline. It does not explicitly distinguish get_tree from siblings such as get_file or search_project, but the object type (tree) makes the primary purpose clear.

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?

The description implies the tool is for retrieving a filtered project tree, which is a common exploration need, but it does not state when to prefer it over siblings like pack_context or search_project, nor any exclusions. There is no explicit alternative routing, so an agent must infer usage from the name and role.

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