get_file_contents
Retrieve file or directory contents from GitHub or GitLab repositories by specifying repository, path, and optional branch/tag reference.
Instructions
Get the contents of a file or directory from a repository
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": {
"repo": "<repo>",
"path": "<path>"
},
"name": "get_file_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository identifier (GitLab: "group/project" or ID, GitHub: "owner/repo") | |
| path | Yes | File or directory path in the repository | |
| ref | No | Branch name, tag, or commit SHA (default: default branch) |