Skip to main content
Glama

MCP GitLab Server

by Vijay-Duke

gitlab_list_repository_tree

List and explore files and directories in a GitLab repository. Supports recursive listing, specific paths, and optional Git references. Use to browse repository structures efficiently.

Instructions

Browse repository directory structure Returns: Array of files and directories Use when: Exploring repo structure, listing files Optional: Recursive listing, specific path

Example response: [{ "name": "src", "type": "tree", "path": "src", "mode": "040000" }, { "name": "README.md", "type": "blob", "path": "README.md", "mode": "100644" }]

Related tools:

  • gitlab_get_file_content: Read file contents

  • gitlab_search_in_project: Search in files

Input Schema

NameRequiredDescriptionDefault
pathNoDirectory path in repository Type: string Format: Relative path using forward slashes Default: '' (empty string for root) Examples: - '' (repository root) - 'src' (src directory) - 'src/components' (nested directory) - 'tests/unit/models' (deeply nested) Note: Don't include trailing slash
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
recursiveNoInclude subdirectories Type: boolean Default: false Options: - true: Include all subdirectories recursively - false: Only immediate children Use case: true for full directory tree, false for folder contents
refNoGit reference Type: string Format: branch name, tag name, or commit SHA Optional: Yes - defaults to project's default branch Examples: - 'main' (branch) - 'feature/new-login' (feature branch) - 'v2.0.0' (tag) - 'abc1234' (short commit SHA) - 'e83c5163316f89bfbde7d9ab23ca2e25604af290' (full SHA) Default: Project's default branch (usually 'main' or 'master')

Input Schema (JSON Schema)

{ "properties": { "path": { "default": "", "description": "Directory path in repository\nType: string\nFormat: Relative path using forward slashes\nDefault: '' (empty string for root)\nExamples:\n - '' (repository root)\n - 'src' (src directory)\n - 'src/components' (nested directory)\n - 'tests/unit/models' (deeply nested)\nNote: Don't include trailing slash", "type": "string" }, "project_id": { "description": "Project identifier (auto-detected if not provided)\nType: integer OR string\nFormat: numeric ID or 'namespace/project'\nOptional: Yes - auto-detects from current git repository\nExamples:\n - 12345 (numeric ID)\n - 'gitlab-org/gitlab' (namespace/project path)\n - 'my-group/my-subgroup/my-project' (nested groups)\nNote: If in a git repo with GitLab remote, this can be omitted", "type": "string" }, "recursive": { "default": false, "description": "Include subdirectories\nType: boolean\nDefault: false\nOptions:\n - true: Include all subdirectories recursively\n - false: Only immediate children\nUse case: true for full directory tree, false for folder contents", "type": "boolean" }, "ref": { "description": "Git reference\nType: string\nFormat: branch name, tag name, or commit SHA\nOptional: Yes - defaults to project's default branch\nExamples:\n - 'main' (branch)\n - 'feature/new-login' (feature branch)\n - 'v2.0.0' (tag)\n - 'abc1234' (short commit SHA)\n - 'e83c5163316f89bfbde7d9ab23ca2e25604af290' (full SHA)\nDefault: Project's default branch (usually 'main' or 'master')", "type": "string" } }, "type": "object" }

Other Tools from MCP GitLab Server

Related Tools

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

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