Skip to main content
File operation tool steps give agents direct access to files stored in a filesystem mount. Agents can read file contents, create new files, make targeted edits, list directory contents, and delete files — all without leaving the Relevance AI platform.

Available file operations

Read file

Read the contents of a file from the filesystem mount.

Write file

Create a new file or overwrite an existing file with new content.

Edit file

Replace a specific string within a file without rewriting the whole file.

List files

List the files and directories at a given path in the filesystem mount.

Delete file

Permanently remove a file from the filesystem mount.

How file operations work

File operations work with filesystem mounts attached to an agent’s environment. A filesystem mount is a persistent storage volume that exists across agent runs. Files written in one run are available in subsequent runs, making it possible for agents to maintain state, accumulate data, and collaborate on shared files. File operations are built-in tool steps — they do not require an external integration or API credentials.

File operations vs. file inputs

File inputs (uploaded through the agent conversation) are read-only references to files provided by a user. File operations, by contrast, work with files stored in the agent’s filesystem mount. Use file operations when:
  • The agent needs to create or modify files as part of its work
  • Files need to persist between agent runs
  • The agent is processing, transforming, or building up a file over multiple steps
Use file inputs when a user needs to hand a file to the agent for one-time processing.

Choosing the right operation

GoalOperation
Read the full contents of a fileRead file
Create a new fileWrite file
Overwrite a file with entirely new contentWrite file
Change a specific part of a fileEdit file
See what files exist in a directoryList files
Remove a fileDelete file
All file operations fail safely with a clear error message if the target file or path does not exist, so agents can handle errors explicitly rather than silently producing bad output.