Create File Tool - EpicStaff/EpicStaff GitHub Wiki

CreateFileTool — User Guide

What this tool does

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.

Where files are created

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.

Inputs

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

What this tool can do

  • 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

What this tool cannot do

  • Overwrite existing files
  • Write content into the file
  • Create files outside the allowed directory
  • Change file permissions
  • Modify existing files

Examples (conceptual)

Creating a new file:

logs/output.txt

If the folders do not exist, they will be created automatically.
The file itself will be empty.

Possible errors and what they mean

File already exists

Message:

File <name> already exists, no need to create it

Meaning:

  • The file is already present
  • The tool intentionally avoids overwriting it

No permission to create file

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

Unexpected error

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

Safety notes

  • 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

When to use this tool

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

When NOT to use this tool

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
⚠️ **GitHub.com Fallback** ⚠️