get_repository_tree
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
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | The name of a repository branch or tag. Defaults to the default branch. | |
| path | No | The path inside the repository | |
| per_page | No | Number of results to show per page | |
| recursive | No | Boolean value to get a recursive tree | |
| page_token | No | Token for keyset pagination. Use the next_page_token value returned in the previous response to retrieve the next page. | |
| pagination | No | 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. | |
| project_id | Yes | The ID or URL-encoded path of the project |