Gh Get File
gh_get_fileGet file contents from a repository. Specify owner, repo name, and file path (e.g., 'README.md'). Returns raw content and metadata.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "README.md",
"repo": "Hello-World",
"owner": "octocat"
},
"name": "gh_get_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch or commit SHA (default: default branch) | |
| path | Yes | File path (e.g., "src/index.ts") | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | File content SHA | |
| url | No | API URL for this file | |
| name | No | File name | |
| path | No | File path in repository | |
| size | No | File size in bytes | |
| type | No | Content type (file or dir) | |
| content | No | Base64 encoded file content | |
| encoding | No | Content encoding (base64) | |
| html_url | No | Web URL for this file | |
| download_url | No | Raw download URL |