Supyagent
ToolsBuilt-in Tools

Find Tool

Reference for the find default tool: find_files, recent_files, and directory_tree.

Find Tool

Script: powers/find.py Dependencies: pydantic

Find files by name, glob pattern, type, modification time, or get a structured directory tree view. Automatically skips common noise directories.


find_files

Find files and directories matching a glob pattern. Returns structured entries with metadata.

Input

FieldTypeDefaultDescription
patternstrrequiredGlob pattern to match (e.g., *.py, test_*.py, Dockerfile*)
pathstr"."Directory to search in
max_resultsint200Maximum number of results to return
include_hiddenboolfalseInclude hidden files/directories (starting with .)
file_typestr"all"Filter by type: "file", "dir", or "all"

Output

FieldTypeDescription
okbooltrue if search completed
entrieslistArray of file entry objects (see below)
total_foundintNumber of entries found
truncatedbooltrue if max_results was reached
errorstrError message on failure

Each entry object:

FieldTypeDescription
pathstrRelative path from search root
namestrFile or directory name
typestr"file" or "dir"
sizeintFile size in bytes (files only)
extensionstrFile extension (files only)

Examples

// Find all Python files
{"pattern": "*.py", "path": "src"}

// Find test files
{"pattern": "test_*.py"}

// Find YAML files in agents directory
{"pattern": "*.yaml", "path": "agents"}

// Find only Dockerfiles (files only)
{"pattern": "Dockerfile*", "file_type": "file"}

// Find directories named "tests"
{"pattern": "tests", "file_type": "dir"}

// Include hidden files
{"pattern": ".*", "include_hidden": true}

Auto-Skipped Directories

The following directories are always skipped during traversal: __pycache__, node_modules, .git, .venv, venv, .tox, .mypy_cache, .pytest_cache, dist, build, .egg-info, .eggs


recent_files

Find files modified within a recent time window. Results are sorted by modification time (most recent first).

Input

FieldTypeDefaultDescription
pathstr"."Directory to search in
minutesint60Find files modified within this many minutes
globstr"*"File glob filter (e.g., *.py)
max_resultsint50Maximum number of results

Output

FieldTypeDescription
okbooltrue if search completed
entrieslistArray of recent file entries (see below)
total_foundintNumber of files found
errorstrError message on failure

Each entry:

FieldTypeDescription
pathstrRelative path
namestrFile name
sizeintFile size in bytes
modified_seconds_agointSeconds since last modification
extensionstrFile extension

Examples

// Files modified in the last 30 minutes
{"minutes": 30, "glob": "*.py"}

// Recently changed files in src/
{"path": "src", "minutes": 10}

// All files changed today
{"minutes": 1440}

directory_tree

Get a structured directory tree view. Returns a nested tree structure showing the project layout.

Input

FieldTypeDefaultDescription
pathstr"."Directory to show tree for
max_depthint3Maximum depth to traverse (1-10)
include_hiddenboolfalseInclude hidden files/directories
include_filesbooltrueInclude files (set false for dirs only)

Output

FieldTypeDescription
okbooltrue if tree was built
treeobjectNested tree structure (see below)
total_filesintTotal files in the tree
total_dirsintTotal directories in the tree
errorstrError message on failure

Each tree node:

FieldTypeDescription
namestrName of the file or directory
typestr"file" or "dir"
childrenlistChild nodes (directories only)
sizeintFile size in bytes (files only)

Examples

// Project overview (default depth 3)
{"path": ".", "max_depth": 2}

// Deep dive into source tree
{"path": "src", "max_depth": 4, "include_files": true}

// Directory structure only
{"path": ".", "max_depth": 3, "include_files": false}

Tips

  • Use find_files for locating specific files by name or extension
  • Use recent_files to see what was recently changed -- useful for understanding recent activity
  • Use directory_tree to get an overview of project structure before diving into specific files
  • All three functions skip the same noise directories automatically
  • Combine find_files with search for a powerful "find the file, then search its contents" workflow