gitlab_file_get
Read one GitLab file at a branch, tag, or commit, defaulting to the project default branch. Pass an MR source branch to view it as the merge request does; capped output flags truncation.
Instructions
Read one file from the repository at a ref. Defaults to the project default branch - pass ref= to read the file as the merge request sees it. Output is capped, and a truncated read says so.
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": {
"project": "<project>",
"path": "<path>"
},
"name": "gitlab_file_get"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | branch, tag or commit SHA; defaults to the project default branch | |
| path | Yes | repository-relative file path, e.g. 'src/app.ts' (no leading slash) | |
| project | Yes | project id ('42') or full path ('group/subgroup/app'); a path is URL-encoded for you | |
| maxChars | No | cap on returned characters; the file itself may be longer |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| url | No | ||
| path | Yes | ||
| size | Yes | characters returned, after truncation | |
| dryRun | No | ||
| content | No | ||
| truncated | Yes |