Get File Contents
get_file_contentsRead file contents, extract symbol outlines, slice line ranges, or list directory entries from a GitHub repository at a git ref without cloning. Automatically decodes Base64 to UTF-8.
Instructions
Read current file contents, extract symbol outlines, slice line ranges, or list directory entries from a repository at a specified git ref without cloning. Automatically decodes Base64 file contents into plain text UTF-8. 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') | |
| end_line | No | Optional 1-based end line to slice file contents | |
| start_line | No | Optional 1-based start line to slice file contents | |
| outline_only | Yes | Extract top-level symbol signatures (functions, classes, interfaces, types) with line numbers to conserve tokens (default: false) |