get_file_content
Read file contents from a GitHub repository at a specified branch, tag, or commit. Retrieves decoded text content for any file path.
Instructions
Read the contents of a file from a GitHub repository at a given ref (branch, tag, or commit SHA). Defaults to the repo's default branch. Text files are returned UTF-8-decoded under 'decoded_content'.
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_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA (optional) | |
| path | Yes | File path within the repo (e.g., 'src/main.py') | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (user or org) |