Github Get Repository File
github_get_repository_fileRead a file from a GitHub repository at a branch, tag, or SHA. Use offset and limit to page through large files, with next_offset to continue; pass 0 as limit to get the file size without content.
Instructions
Reads one file from a repository at ref, windowed to limit bytes from offset. bytes_total is the whole file either way and next_offset says where to carry on, so a partial read never passes for the lot. A directory belongs to github_list_repository_tree. See #409.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag or SHA to read at. Omit for the default branch | |
| path | Yes | File path from the repository root, e.g. src/mcp_github/auth.py | |
| limit | No | Cap on the bytes returned. Pass 0 to learn the size without reading | |
| offset | No | Byte to start the window at. Pass a previous next_offset to carry on | |
| repo_name | Yes | ||
| repo_owner | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| path | Yes | ||
| binary | Yes | ||
| content | Yes | ||
| truncated | Yes | ||
| bytes_total | Yes | ||
| next_offset | Yes | ||
| bytes_returned | Yes |