Github Get Repository File
github_get_repository_fileReads a file from a GitHub repository at a given ref, supporting byte-offset windows and continuation for partial reads, enabling efficient analysis of large files.
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.
Workflow and conventions: github_get_skill('pr-analysis').
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 |