Add the List files tool step to your tool
- Open your tool and click + Add step.
- Search for List files and select it.
- Enter the Directory path — the path to the directory you want to list within the filesystem mount.
- Click Run step to test the listing and review the output.
Parameters
The path to the directory to list, relative to the filesystem mount root. For example:
reports/ or data/exports. Use / or an empty string to list the root of the filesystem mount.Output
The step returns a list of file and directory names found at the specified path. The output includes both files and subdirectories, but does not recurse into subdirectories — only the immediate contents are returned.Examples
Listing all files in a directory
Listing all files in a directory
An agent checks what report files have accumulated in the
Example output:
reports/ directory:| Parameter | Value |
|---|---|
directory_path | reports/ |
Listing the root of the filesystem mount
Listing the root of the filesystem mount
An agent lists all top-level directories and files to understand the overall structure:
Example output:
| Parameter | Value |
|---|---|
directory_path | / |
Dynamically processing each file in a directory
Dynamically processing each file in a directory
An agent uses List files to get all filenames in
The output list is passed to a Python code step that loops through each filename and constructs the full path for subsequent Read file calls.
data/incoming/, then iterates over the list in a Python code step to process each file individually using Read file steps.| Parameter | Value |
|---|---|
directory_path | data/incoming/ |
When to use List files
- Before reading or editing a file, to confirm it exists at the expected path
- To iterate over a directory of files for batch processing
- To check whether a file has been created by a previous step or agent run
- To audit what files an agent has produced over multiple runs
Frequently asked questions (FAQs)
What happens if the directory does not exist?
What happens if the directory does not exist?
The step returns an error. The directory must exist in the filesystem mount before it can be listed.
Does List files recurse into subdirectories?
Does List files recurse into subdirectories?
No. List files returns only the immediate contents of the specified directory. To list files recursively, use a Python code step with
os.walk.Does the output include full file paths or just names?
Does the output include full file paths or just names?
The output includes only the file and directory names, not the full paths. Prepend the directory path in a subsequent step if you need the full path to pass to Read file, Edit file, or Delete file.

