Skip to main content
Glama

get_repository_tree

Read-only

List files and directories in a GitLab repository to browse project structure. Supports recursive trees, branch/tag refs, path filtering, and pagination for large repos.

Instructions

List files and directories in a repository. Read-only; missing resources, denied access, and rate limits return errors. project_id/group_id take a numeric ID or URL-encoded path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoThe name of a repository branch or tag. Defaults to the default branch.
pathNoThe path inside the repository
jmespathNoOptional JMESPath expression filtering the JSON result before return.
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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Addedv2.1.45
  3. Removedv2.1.43
  4. Addedv2.1.18
  5. Removedv2.1.14
  6. Addedv2.1.11
  7. Removedv2.1.10
  8. Changed4 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / page_token / description
      Previous value: -"The tree record ID for pagination"New value: +"Token for keyset pagination. Use the next_page_token value returned in the previous response to retrieve the next page."
    • changedInput schema / properties / pagination / description
      Previous value: -"Pagination method (keyset)"New value: +"Pagination 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."
    • addedInput schema / required
      Added value: +[
      +  "project_id"
      +]
  9. First observedv1.0.0

TDQS

A3.5/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 genuine behavioral context: missing resources, denied access, and rate limits all surface as errors. That failure-mode disclosure is value the annotations do not provide, though nothing is said about result size or truncation behavior.

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?

Two tight sentences with the core action front-loaded and zero filler. However, the trailing '`project_id`/`group_id`' note mentions group_id, which is not a parameter of this schema, adding a small bit of noise.

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 an 8-parameter read tool with no output schema and full schema coverage, the description covers the operation, safety profile, and failure modes adequately. Return-shape and pagination semantics are handled by the schema, so little is genuinely missing.

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 all eight parameters including pagination, jmespath, and recursive are already documented in the schema. The description's note about project_id accepting a numeric ID or URL-encoded path merely restates the schema, so baseline 3 applies.

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?

States a specific verb+resource (list files and directories) clearly, so an agent knows exactly what it retrieves. It does not explicitly contrast itself with near siblings like get_file_contents or get_branch, so it falls just short of a 5.

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

Usage Guidelines2/5

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

The description never states when to use this tool versus alternatives such as get_file_contents (single file) or search_repositories. Usage is only implied by the word 'List', with no conditions or exclusions spelled out.

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