Get File Contents
get_file_contentsRead file contents or list directory entries from a GitHub repository at a specified git ref without cloning. Decode Base64 file contents into UTF-8 plain text for source code inspection.
Instructions
Read current file contents or list directory entries from a repository at a specified git ref without cloning. Automatically decodes Base64 file contents into plain text UTF-8 in 'decoded_content'. Eager daily driver tool for inspecting source code, configuration files, and directory layouts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Git reference (branch name, tag, or commit SHA) to read from (default: default branch / HEAD) | |
| path | Yes | Relative path to file or directory in repository (e.g. 'README.md', 'src/index.js', or '' for root) | |
| repo | Yes | Repository name (e.g. 'Hello-World' or 'mcp-github') | |
| owner | Yes | Repository owner (user or organization, e.g. 'octocat' or 'buggycode') |