Get file contents
gitlab_get_fileRead file contents from a GitLab repository, returning text or viewable images by specifying branch, tag, or commit.
Instructions
Reads a file from the repository. Text comes back decoded; set as_image=true to look at an image committed to the repo.
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 commit SHA (default: default branch) | |
| as_image | No | Return the file as a viewable image (for PNG/JPEG/GIF/WebP stored in the repo) | |
| file_path | Yes | Path inside the repository, e.g. `src/index.ts` | |
| project_id | No | Project id or URL-encoded path, e.g. `42` or `group/subgroup/project`. Falls back to GITLAB_PROJECT_ID. |