github_read_file
Fetch the decoded text of a file stored in a GitHub repository. Specify the repository, file path, and optionally a branch or commit reference.
Instructions
Read the full content of a file in a GitHub repository. Returns the decoded text. Files larger than 512 KB or detected as binary are rejected. Works without a token (anonymous rate limits apply — set GITHUB_TOKEN for higher limits).
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_read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Git ref (branch name, tag, or commit SHA). Defaults to the repo's default branch. | |
| path | Yes | Path to the file inside the repo (forward slashes). | |
| repo | Yes | GitHub repository in the form 'owner/repo' |