Read File
read_fileRead text files and extract text from PDF files on the local filesystem. Supports line offset, line cap, and line numbers for precise navigation.
Instructions
Read a file from the local filesystem. Text files are returned as-is (UTF-8); PDF files are detected automatically and their text is extracted page by page.
Args:
path (string): Absolute or ~-relative file path.
offset (number): Start reading at this 1-based line (default 1). Use with max_lines to page through big files.
max_lines (number): Optional cap on lines returned.
line_numbers (boolean): Prefix each line with "N: " (default false). Use before edit_lines, so you know the exact line numbers.
Returns the file contents. Use list_directory first if unsure of the path.
Example: { "path": "/project/README.md" } or { "path": "/app.py", "offset": 100, "max_lines": 50, "line_numbers": true }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path (absolute or ~-relative) | |
| offset | No | 1-based start line | |
| max_lines | No | Optional line cap | |
| line_numbers | No | Prefix lines with "N: " |