Get a GitHub file
github_get_file_contentsRead the contents of a text file from a repository you can access with a GitHub connection (your own or one shared with you). Returns the decoded file text. Optionally specify a branch, tag, or commit ref.
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": "github_get_file_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional branch, tag, or commit SHA. | |
| path | Yes | Path to the file within the repository. | |
| repo | Yes | Repository in "owner/repo" form, e.g. octocat/Hello-World. The owner is the GitHub LOGIN exactly as it appears in the repository URL (github.com/<owner>/<repo>) — not a display name, and not the connection's name. | |
| connection | No | Which GitHub connection to use, by its name from github_list_connections. This is a local label for the connection, NOT a GitHub username — for anything GitHub has to resolve, use that connection's login instead. Optional when you have exactly one. |