get_file
Read a file from a GitHub repository by specifying owner, repo, and file path, with support for optional branch or SHA reference.
Instructions
Read a file from a repo via the Contents API.
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": {
"owner": "<owner>",
"repo": "<repo>",
"path": "<path>"
},
"name": "get_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | GitHub owner/org name. | |
| repo | Yes | Repository name. | |
| path | Yes | File path within the repo, no leading slash. | |
| ref | No | Branch, tag, or SHA. Default: the default branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||