Skip to main content
Glama

Get repository tree

get_repo_tree
Read-only

Reads a repository's git tree at a branch, tag, or commit; use recursive mode to list every file path in one request and detect truncation before concluding a file is absent.

Instructions

Read a repository's git tree (owner/repo, optional sha — a branch, tag or commit, defaulting to HEAD). With recursive=true the whole tree arrives in one request, which answers "where is every file of this kind" without descending directory by directory; without it, one level. Entries are path, type (blob/tree/commit), size and sha. Check truncated: the forge stops early on a large tree, and concluding "there is no such file" from a truncated listing is unsound. For one directory's entries with no recursion, get_file_contents on a directory path is cheaper.

Input Schema

NameRequiredDescriptionDefault
shaNoTree to read: a branch, tag or commit. Defaults to the repository's default branch.
pageNo1-based page number.
repoYesRepository name.
limitNoResults per page.
ownerYesRepository owner — user or organization.
recursiveNoWalk the whole tree rather than one level. Off by default, since a large repository returns thousands of entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.22.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, but the description adds real value: the truncation failure mode and the warning that absence from a truncated listing does not prove absence, plus the shape of returned entries. It stops short of describing pagination behavior for the page/limit params, so not a full 5.

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?

Purpose and scope come first, then the recursive tradeoff, then return shape, then the truncation caveat, then the sibling alternative. Every clause carries distinct information with no restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description supplies the return fields (path, type, size, sha) and a critical correctness caveat about truncated results, which is exactly what an agent needs to use this tool soundly.

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 coverage is 100%, so baseline is 3; the description adds meaning on top by clarifying sha accepts a branch/tag/commit and defaults to HEAD, and by framing recursive as a cost/volume tradeoff rather than just a flag. Page/limit semantics are left to the schema.

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?

States a specific verb and resource ('Read a repository's git tree') with the addressing scheme (owner/repo, optional sha) up front. It is clearly distinguished from get_file_contents, which is named as the tool for one directory's entries.

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?

Explicitly explains the recursive=true vs. non-recursive choice, including the motivating use case ('where is every file of this kind'), and names an alternative with the exact condition that selects it (get_file_contents on a directory path is cheaper for one level).

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