get_file_contents
Retrieve file contents or directory listings from GitHub repositories. Specify owner, repo, and path to access structured JSON data with type information for consistent parsing.
Instructions
Get the contents of a file or directory listing in a repository. Returns JSON with a 'type' field ('file' or 'directory') for consistent parsing.
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 |
|---|---|---|---|
| owner | Yes | Repository owner | |
| repo | Yes | Repository name | |
| path | Yes | File path in the repository | |
| ref | No | Branch name, tag, or commit SHA (defaults to default branch) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |