Skip to main content
Glama

get_repository_tree

Read-only

List files and directories in a GitLab repository to inspect its structure. Retrieve the tree for a specific path, branch, or tag, with optional recursion and pagination for large repositories.

Instructions

List files and directories in a repository. Use this for a known resource or result; choose the corresponding list or search tool when you need to discover multiple resources. It is read-only and does not mutate GitLab data; missing resources, invalid identifiers, insufficient permission, and rate limits are returned as errors. When project_id or group_id is accepted, provide the numeric ID or complete URL-encoded path described by the schema; use required identifiers and pagination fields exactly as documented.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoThe name of a repository branch or tag. Defaults to the default branch.
pathNoThe path inside the repository
per_pageNoNumber of results to show per page
recursiveNoBoolean value to get a recursive tree
page_tokenNoToken for keyset pagination. Use the next_page_token value returned in the previous response to retrieve the next page.
paginationNoPagination method. Use 'keyset' for keyset-based pagination (required for repositories with many files). Non-keyset calls keep the legacy array response for backward compatibility; that legacy response shape is deprecated and may be removed in a future major release. Keyset calls return a structured response with items and next_page_token when more pages are available.
project_idYesThe ID or URL-encoded path of the project
Install Server

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, and the description reinforces this while adding concrete error behavior: missing resources, invalid identifiers, insufficient permission, and rate limits are returned as errors. This goes beyond the annotations and helps the agent anticipate failure modes.

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 main purpose is front-loaded, and the description is compact. The sentence about project_id/group_id is somewhat redundant with the schema, but overall the text is well-structured and each sentence contributes to usage or behavior.

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 read-only listing tool, the description covers purpose, usage context, error behavior, and pagination guidance. There is no output schema, so a bit more detail about the success response shape would help, but the schema's pagination field description partially fills that gap.

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 baseline is 3. The description mostly restates schema guidance about numeric IDs, URL-encoded paths, and pagination. It adds little new parameter-level meaning and even mentions group_id, which is not a parameter in this schema, creating minor ambiguity.

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 action and resource ('List files and directories in a repository') and clarifies that it is for a known resource rather than discovery. It distinguishes from list/search tools generically, but does not name a specific sibling, so it is clear but not maximally specific.

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?

It explicitly says to use this tool for a known resource or result and to choose the corresponding list or search tool when discovering multiple resources. This gives a clear when/when-not boundary, though it does not name concrete alternative tools.

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

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/zereight/gitlab-mcp'

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