get_file_contents
Retrieves the contents of a specified file from a GitHub repository, optionally at a given branch, tag, or commit, so you can read source files and configs directly.
Instructions
Get the contents of a file in 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": {
"owner": "<owner>",
"repo": "<repo>",
"path": "<path>"
},
"name": "get_file_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA (defaults to default branch) | |
| path | Yes | Path to the file | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner |