GitHub tree
github_treeLists files and directories in a GitHub repository at a branch, tag, or commit, with optional recursive traversal, glob and path-prefix filters, entry limits, and summary-only output.
Instructions
List files and directories in a repository at a ref, using the git trees API. Use recursive=true only when the full tree is needed; a glob containing / or ** implies recursion unless recursive is explicitly false. path_prefix filters entry paths by literal prefix and is applied with glob before max_entries. max_bytes (default 2 MiB, max 16 MiB) clips the raw response locally; local clipping, the entry cap, and GitHub truncation all set truncated while api_truncated stays upstream-only, and a clipped response's hint names max_bytes. summary_only drops entries and returned_entries and answers with total_bytes plus top_dirs totals for the full tree instead; a recursive timeout degrades to one top-level retry with degraded:true and a hint. Returns {ref, path, entries[{path, type, size, sha}], total_entries, returned_entries, summary, truncated, api_truncated}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo": "<repo>"
},
"name": "github_tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit; defaults to the repository default branch | |
| glob | No | Filter returned entries by glob pattern, e.g. **/dev-overlay/** or src/*.ts; filters the entry list only — use github_file_grep to search file contents | |
| path | No | Subdirectory path inside the ref | |
| repo | Yes | Repository in owner/name form | |
| fresh | No | Bypass the local cache | |
| max_bytes | No | Maximum raw response bytes to keep, default 2 MiB, max 16 MiB; local clipping sets truncated with a max_bytes hint | |
| recursive | No | Return the complete tree recursively | |
| max_entries | No | Maximum entries returned, 1-10000, default 1000 | |
| path_prefix | No | Filter returned entries by a literal path prefix, e.g. docs/ | |
| summary_only | No | Omit entries and return total_bytes plus top_dirs for the full tree instead; max_entries, path_prefix, and glob are ignored; use with recursive: true |