CleanClean
MCP Tools

get_file_tree

Print the directory structure of an indexed repository.

get_file_tree returns an indented tree of all code-relevant files and directories in an indexed repo. Use it as your first step when exploring an unfamiliar codebase, or when search results reference paths you don't recognise.

Inputs

NameTypeRequiredDefaultDescription
repostringautoRepository in owner/repo format. Omit to auto-select when only one repo is indexed.
branchstringdefaultGit branch to inspect. Omit to use the repo's default branch.
depthinteger4Maximum directory depth to display. Clamped to 10.
include_hiddenbooleanfalseInclude hidden directories (those starting with .).

When to call it

  • As your first step when exploring an unfamiliar codebase.
  • When you need to understand how files are organised — route structures, component folders, where code lives.
  • When search_code results reference paths you don't recognise.
  • When you're looking for config files, test directories, or assets.

Example

{ "name": "get_file_tree", "arguments": { "repo": "facebook/react", "depth": 3 } }

Notes

  • The repo must be indexed and in the ready state — check with list_repos.
  • Tree building has a 30-second timeout.

On this page