get_file_contents
Fetch a file's decoded text content or raw metadata from a GitHub repo using repository name, file path, and optional branch, tag, or commit SHA.
Instructions
Get decoded text content or raw metadata of a file in a GitHub repository.
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_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Git branch name, tag, or commit SHA (e.g. "main", "v1.0.0") | |
| path | Yes | Relative path to the file in the repository (e.g. "package.json", "src/index.ts") | |
| repo | Yes | Repository name | |
| owner | No | GitHub user or organization name (optional if GITHUB_OWNER is set) |