github_get_file
Read a text file from a GitHub repository at a branch, tag, or commit. Long files are truncated and flagged, making repository file inspection clear.
Instructions
Read a text file. Long files are cut and flagged truncated. For a directory use github_list_directory.
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": {
"path": "<path>"
},
"name": "github_get_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag or commit sha. Defaults to the repo's default branch. | |
| path | Yes | ||
| repo | No | Repository as 'owner/name'. Defaults to GITHUB_MCP_DEFAULT_REPO when omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| path | Yes | ||
| size | Yes | ||
| content | Yes | ||
| truncated | Yes |