Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agentstack.sh/llms.txt

Use this file to discover all available pages before exploring further.

File Read

This tool allows agents to read files stored locally on the system.

Installation

To install the File Read tool, run the following command:
agentstack tools add file_read

Functions

file_read.read_file(file_path: str) -> str

Reads the contents of a file at the given path.

Parameters:

  • file_path (str): Path to the file to read

Returns:

  • str: The contents of the file as a string

Raises:

  • FileNotFoundError: If the file does not exist
  • PermissionError: If the file cannot be accessed
  • Exception: For other file reading errors

Notes

  • The agent has access to the local file system.
  • Ensure that the agent has the necessary permissions to read the file.
  • Large files may consume significant memory when read entirely into a string.