GitHub read file
github_read_fileRead the content of ONE named file from a GitHub repository - 'path' is required and names that file. To see what a repository or directory CONTAINS, call github_list_repository_files instead (its 'path' is optional). Prefer the exact owner from github_list_repositories; 'repo' also accepts the combined 'owner/name' form. Use this to inspect Dockerfiles, package.json, CI configs, Helm charts, source code, and other text files. Refuses to read known sensitive files (.env, private keys, etc.).
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 |
|---|---|---|---|
| path | Yes | Required. Path of the single file to read, within the repository (e.g. 'Dockerfile', 'src/index.ts', '.github/workflows/deploy.yml'). To list a directory rather than read a file, use github_list_repository_files. | |
| repo | Yes | Repository name. Also accepts the combined 'owner/name' form. | |
| owner | No | Repository owner (e.g. 'octocat'). Prefer the exact owner from a prior github_list_repositories call. May be omitted when the repository name is unambiguous in this organisation, or embedded in 'repo' as 'owner/name'. | |
| branch | No | Branch name. Defaults to the repository's default branch. | |
| max_lines | No | Maximum number of lines to return, counted from start_line. Omit for no line cap. | |
| start_line | No | 1-based line to start from. With max_lines, pages through files too large to read in one call. Omit to read from the top. |