Skip to main content
Glama

get_repository_tree

Retrieve a GitHub repository's directory structure and file listing by SHA or branch name. Use recursive mode to obtain complete nested file trees for comprehensive repository analysis.

Instructions

Get a repository tree (directory listing) by SHA or branch name. Set recursive=True to get the full nested file tree.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
tree_shaYesSHA of the tree, commit, or branch name (e.g. 'main')
recursiveNoRecursively get all nested trees

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the recursive behavior option, which is useful context. However, it doesn't mention important behavioral aspects like rate limits, authentication requirements, pagination behavior, error conditions, or what the tree structure output looks like.

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?

The description is perfectly concise with two focused sentences that each earn their place. The first sentence states the core purpose, and the second provides essential usage guidance about the recursive parameter. No wasted words or redundant information.

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 tool has an output schema (which handles return values) and 100% schema coverage, the description provides adequate context for a read-only operation. However, for a tool with no annotations, it could benefit from mentioning authentication requirements or rate limits to be fully complete.

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 already documents all parameters thoroughly. The description adds minimal value beyond the schema - it mentions the recursive parameter's purpose but doesn't provide additional semantic context about parameter interactions or usage nuances.

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 the specific action ('Get a repository tree') and resource ('directory listing'), specifying it can be retrieved by SHA or branch name. It distinguishes from sibling tools like get_file_contents (which gets file content) or list_branches (which lists branches without tree structure).

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?

The description provides clear context about when to use the recursive parameter ('Set recursive=True to get the full nested file tree'), which helps guide usage. However, it doesn't explicitly state when NOT to use this tool versus alternatives like get_file_contents for individual files or list_commits for commit history.

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/software-engineer-mj/github-mcp'

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