read_text_file
Retrieve and display the contents of a text file from the file system. Specify a file path to read it in full or use 'head' or 'tail' parameters to extract specific lines. Supports various text encodings and provides clear error messages if the file cannot be accessed.
Instructions
Read the complete contents of a file from the file system as text. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Use the 'head' parameter to read only the first N lines of a file, or the 'tail' parameter to read only the last N lines of a file. Operates on the file as text regardless of extension. Only works within allowed directories.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
head | No | If provided, returns only the first N lines of the file | |
path | Yes | ||
tail | No | If provided, returns only the last N lines of the file |