get_file_contents
Fetch a file's content from a GitHub repository at a specific branch, tag, or commit. Provide owner, repo, and file path to read the raw file content.
Instructions
Read a file's contents from a repo at a given ref.
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_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit sha; defaults to the default branch | |
| path | Yes | File path within the repo, e.g. src/index.ts | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (user or org) |