github_mcp.read_file
Read a repository file from the default branch or an existing job workspace, returning its content, encoding, byte count, checksum and snapshot SHA for safe edits.
Instructions
Read a safe file from the default-branch snapshot or an existing job workspace. Returns content, encoding, byte count and SHA-256 checksum for subsequent edits; text reads also return snapshot SHA. Secret scanning and file-size limits apply.
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": {
"repository": "<repository>",
"path": "<path>"
},
"name": "github_mcp.read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Repository-relative file path, not an absolute path. | |
| binary | No | Allow base64 output for non-UTF-8 content; default false. | |
| job_id | No | Optional existing job ID to read its workspace instead of the default branch. | |
| repository | Yes | Allowlisted owner/repo identifier; must match the job if supplied. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| message | No | ||
| error_code | No |