Read repository file
gitlab_get_fileRetrieve file content from a GitLab repository at a specified branch, tag, or commit. Access .gitlab-ci.yml or configuration files without a local clone.
Instructions
Returns file content at a ref (branch, tag, or commit SHA). Useful for .gitlab-ci.yml or configs without a local clone.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>"
},
"name": "gitlab_get_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or SHA. Default: project default_branch. | |
| file_path | Yes | File path in the repo (e.g. .gitlab-ci.yml, src/main.ts). | |
| max_chars | No | ||
| repo_path | No | Absolute local clone path; resolves project and MR from current branch. | |
| project_id | No | Numeric ID or group/repo path on GitLab. |