Skip to main content
Glama

Get Repository Tree

gitlab_get_repository_tree
Read-onlyIdempotent

Lists files and directories in a GitLab repository tree and supports pagination to navigate large trees.

Instructions

List files and directories in a repository tree. For large trees pass pagination=keyset and follow next_page_token as page_token; offset page/per_page also work.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "gitlab_get_repository_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
pageNo
pathNo
per_pageNo
recursiveNo
page_tokenNo
paginationNo
project_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv1.7.0
    • removedInput schema / properties / page / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / page / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • addedInput schema / properties / page_token
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 1024,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedInput schema / properties / pagination
      Added value: +{
      +  "enum": [
      +    "keyset"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / path / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / path / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / per_page / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / per_page / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedInput schema / properties / recursive / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / recursive / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
  2. First observedv1.6.1

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare this a safe, idempotent, non-destructive read, so the description correctly spends its words elsewhere. It adds real operational behavior not present in the schema: that large trees must use keyset pagination and that the returned next_page_token is fed back as page_token. It does not describe the shape of tree entries, which matters given there is no output schema.

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 purpose front-loaded and no filler. The pagination clause is dense but each phrase carries information; slightly more structure around the offset alternative would help.

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

Completeness3/5

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

For an 8-parameter, read-only listing tool with no output schema, the definition covers purpose and the pagination loop but leaves most parameters and the returned entry structure unexplained. It is workable for a simple call but under-specified for anything beyond default listing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 8 parameters, so the description must carry the load, but it only explains pagination, page_token, page and per_page. Highly consequential parameters such as recursive, path, ref and project_id are given no meaning at all, leaving the agent to guess their semantics from names.

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?

Names a specific verb and resource ('List files and directories in a repository tree'), which is unambiguous about the operation and its scope. It does not differentiate itself from retrieval siblings such as gitlab_get_file_contents or gitlab_get_file_blame, but an agent can still tell what this tool returns.

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?

Guidance is confined to pagination strategy: use keyset for large trees and offset page/per_page otherwise. There is no guidance on when to prefer this tool over file-contents or blame siblings, and no mention of required context like project_id/ref defaults.

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

Deploy Server

Other Tools