Add a repo_tree tool that returns the full directory tree of a repo (up to configurable depth) in a single call, instead of requiring repeated dir_list calls per directory.
Gitea API
GET /api/v1/repos/{owner}/{repo}/git/trees/{sha}?recursive=true
Flat list of {path, type (file|dir), size, sha} entries, filtered to max_depth.
Required token permission
read:repository scope — same as existing tools, no new permissions needed.
Risk classification
LOW — read-only.
Motivation
During repo scouting (2026-05-14 session), exploring 6 repos required ~12 separate dir_list calls to understand structure. A single repo_tree call would have replaced all of them. Critical for efficient agent-driven repo exploration.
Implementation notes
Use Gitea's recursive tree API — don't implement recursion manually
Cap at max_depth to avoid huge responses on deep repos
## Summary
Add a `repo_tree` tool that returns the full directory tree of a repo (up to configurable depth) in a single call, instead of requiring repeated `dir_list` calls per directory.
## Gitea API
`GET /api/v1/repos/{owner}/{repo}/git/trees/{sha}?recursive=true`
## Tool spec
```
tool: repo_tree
params:
owner: string
name: string
ref: string? // branch/tag/SHA, defaults to default branch
max_depth: int? // default: 3, max: 5
path: string? // subtree root, defaults to repo root
```
## Returns
Flat list of `{path, type (file|dir), size, sha}` entries, filtered to max_depth.
## Required token permission
`read:repository` scope — same as existing tools, no new permissions needed.
## Risk classification
**LOW** — read-only.
## Motivation
During repo scouting (2026-05-14 session), exploring 6 repos required ~12 separate `dir_list` calls to understand structure. A single `repo_tree` call would have replaced all of them. Critical for efficient agent-driven repo exploration.
## Implementation notes
- Use Gitea's recursive tree API — don't implement recursion manually
- Cap at max_depth to avoid huge responses on deep repos
- Filter out `.git` internals
- Consider size limit: truncate if > 200 entries, return truncation warning
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add a
repo_treetool that returns the full directory tree of a repo (up to configurable depth) in a single call, instead of requiring repeateddir_listcalls per directory.Gitea API
GET /api/v1/repos/{owner}/{repo}/git/trees/{sha}?recursive=trueTool spec
Returns
Flat list of
{path, type (file|dir), size, sha}entries, filtered to max_depth.Required token permission
read:repositoryscope — same as existing tools, no new permissions needed.Risk classification
LOW — read-only.
Motivation
During repo scouting (2026-05-14 session), exploring 6 repos required ~12 separate
dir_listcalls to understand structure. A singlerepo_treecall would have replaced all of them. Critical for efficient agent-driven repo exploration.Implementation notes
.gitinternalsShipped in v0.2.3. Closing during cleanup pass.