read_text_file
Access and extract specific lines from UTF-8 text files within allowed directories. Provide file path and optional line range (1-indexed) to retrieve desired content.
Instructions
Read the contents of a UTF-8 text file, optionally within a line range.
Args: path (str): File path to read (absolute or relative to allowed directories) fromLine (int, optional): Starting line number (1-indexed, inclusive) toLine (int, optional): Ending line number (1-indexed, inclusive)
Returns: str: File contents as text, or error message if failed
Note: - Path must be within allowed directory roots - Only reads UTF-8 text files (binary files will return error) - If line range specified, returns only those lines - Line numbers are 1-indexed
Input Schema
Name | Required | Description | Default |
---|---|---|---|
fromLine | No | ||
path | Yes | ||
toLine | No |