Skip to main content
The Read file tool step retrieves the full text contents of a file stored in the filesystem mount and makes it available as output for the next step in your tool.

Add the Read file tool step to your tool

  1. Open your tool and click + Add step.
  2. Search for Read file and select it.
  3. Enter the File path — the path to the file you want to read within the filesystem mount.
  4. Click Run step to test the read and confirm the file contents appear in the output.

Parameters

file_path
string
required
The path to the file to read, relative to the filesystem mount root. For example: reports/summary.txt or data/records.json.

Output

The step returns the full text content of the file as a string. You can reference this output in subsequent steps using the step output variable.

Examples

An agent needs to summarize a daily report. The report is saved to reports/daily.txt by a previous step.
ParameterValue
file_pathreports/daily.txt
The step output (the file contents) is then passed to an LLM tool step with a prompt like: Summarize the following report: {{read_file.output}}.
An agent reads its own configuration before starting a task:
ParameterValue
file_pathconfig/agent_settings.json
The output is a JSON string that can be parsed in a subsequent Python code step or passed directly to an LLM.

When to use Read file

  • Before editing a file, to check its current contents
  • To pass file contents to an LLM tool step for analysis or summarization
  • To retrieve data written by a previous agent run (because files in filesystem mounts persist between runs)
  • To load configuration or state that was saved in an earlier step

Frequently asked questions (FAQs)

The step returns an error and produces no output. Subsequent steps that depend on the output will not run unless your tool handles the error explicitly.
Very large files may exceed the context limits of downstream LLM tool steps. For large files, consider using the Python code step to extract only the relevant section before passing it to an LLM.
No. Read file is designed for text files. For binary files such as PDFs or images, use the Convert PDF to text or File to text tool steps instead.
Yes. Read file only works with files stored in the agent’s filesystem mount. It cannot read files from external URLs or storage services directly.