Create File Tool - EpicStaff/EpicStaff GitHub Wiki
This tool creates a new empty file at the specified location.
It is designed to work safely inside a limited folder and will not create files outside the allowed directory.
All files must be created inside a permitted folder defined by the system.
- This folder is controlled by the environment variable
CONTAINER_SAVEFILES_PATH - If not configured, the current working folder is used
Files can be created in this folder or any of its subfolders.
The tool needs one thing to run in your agentic workflows:
-
File path
- Path where the file should be created
- Relative to the allowed folder
- File name must be included
- Create a new empty file
- Automatically create missing folders in the path
- Prevent overwriting existing files
- Work safely inside restricted spaces during multi agent orchestration
- Protect system folders from modification
- Overwrite existing files
- Write content into the file
- Create files outside the allowed directory
- Change file permissions
- Modify existing files
Creating a new file:
logs/output.txt
If the folders do not exist, they will be created automatically.
The file itself will be empty.
Message:
File <name> already exists, no need to create it
Meaning:
- The file is already present
- The tool intentionally avoids overwriting it
Message:
Given filepath doesn't have access to the specified directory.
Meaning:
- The path is outside the allowed folder
- Or the system does not allow file creation there
Message:
Didn't manage to create a file. Unexpected exception occurred: ...
Meaning:
- A system or filesystem error occurred
- The path may be invalid
- Storage may be unavailable
- The tool blocks access to system folders for your LLM agents
- Attempts to use paths like
../are rejected - Existing files are protected from being overwritten
Use this tool when you:
- Need to create a new file
- Want folders to be created automatically
- Need a safe way to prepare a file for later writing
- Are working inside containerized or restricted environments
Avoid using this tool when you:
- Need to overwrite an existing file
- Want to write content immediately
- Need to create files outside the allowed directory