get_file
Read a file's UTF-8 text or list a directory from a GitHub repository at any branch, tag, or commit. Provide repo, path, and optional ref.
Instructions
Read a file's content (UTF-8 text) or list a directory from a repository at a given branch, tag, or commit. Pass path '' or '/' for the repository root.
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": "get_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA (default: default branch) | |
| path | Yes | File or directory path within the repo ('' for root) | |
| repo | Yes | Repository name (without owner) | |
| owner | No | Repo owner; defaults to GITHUB_DEFAULT_OWNER |