Get repository tree
get_repo_treeReads a repository's git tree at a branch, tag, or commit; use recursive mode to list every file path in one request and detect truncation before concluding a file is absent.
Instructions
Read a repository's git tree (owner/repo, optional sha — a branch, tag or commit, defaulting to HEAD). With recursive=true the whole tree arrives in one request, which answers "where is every file of this kind" without descending directory by directory; without it, one level. Entries are path, type (blob/tree/commit), size and sha. Check truncated: the forge stops early on a large tree, and concluding "there is no such file" from a truncated listing is unsound. For one directory's entries with no recursion, get_file_contents on a directory path is cheaper.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | Tree to read: a branch, tag or commit. Defaults to the repository's default branch. | |
| page | No | 1-based page number. | |
| repo | Yes | Repository name. | |
| limit | No | Results per page. | |
| owner | Yes | Repository owner — user or organization. | |
| recursive | No | Walk the whole tree rather than one level. Off by default, since a large repository returns thousands of entries. |