get_file_content
Retrieve file content from GitHub repositories to examine source code, understand implementations, or read configuration files directly.
Instructions
Get content of a specific file from a GitHub repository.
USE THIS WHEN: You need to read the actual source code or contents of a specific file.
BEST FOR: Examining implementation details, understanding how code works, or reading configuration files.
Returns the full file content (UTF-8 text only, binary files are rejected).
Automatically handles:
- Base64 decoding from GitHub API
- UTF-8 conversion with safe truncation
- Binary file detection
Args:
repo: Repository in format "owner/repo" (e.g., "psf/requests")
path: Path to file (e.g., "requests/api.py")
max_bytes: Maximum content size (default 100KB, increase for large files)
Returns:
JSON with file content, size, truncation status, and metadata
Example: get_file_content("psf/requests", "requests/api.py") → Returns source code of api.py
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | ||
| path | Yes | ||
| max_bytes | No |