get_file_contents
Read a text file, list a directory, or view a repository tree in a public GitHub repository. Use it after searching to open and inspect the result.
Instructions
Read a text file, list a directory, or show a repository's tree, in a public GitHub repository. Use it after a search to open what you found.
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>"
},
"name": "get_file_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag or commit SHA. Defaults to the default branch. | |
| path | No | File or directory path. Empty lists the repository root. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner: a user or organization name. | |
| end_line | No | Last line to return, inclusive. At most 400 lines are returned per call. Ignored for directories. | |
| recursive | No | For a directory: show its whole subtree instead of a single level. | |
| start_line | No | First line to return (1-based). Ignored for directories. |