Get file content
get_file_contentRead a file from a Git repository at a specified branch, commit, or tag. Returns text inline or base64 for binaries, with error details if the path is missing.
Instructions
Read a file from a Git repository at a given branch/commit/tag (default: the repo's default branch). Text files are returned inline; binaries as base64. If the file does not exist, the error explains whether the repository, the branch or the directory is missing and lists the parent directory's entries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Tag name (alternative to branch). | |
| path | Yes | Path inside the repository, e.g. '/src/app/main.ts'. | |
| branch | No | Branch name (e.g. 'develop'). Defaults to the repository's default branch. | |
| commit | No | Commit SHA (alternative to branch). | |
| project | No | Team project name or id that owns the repository. Overrides TFS_DEFAULT_PROJECT. | |
| maxBytes | No | Truncate content beyond this many bytes (binaries are omitted entirely). | |
| repository | Yes | Repository name or id. |