read
Read file contents with line numbers, auto-detect encoding for text files, and handle images as base64. Supports reading specific line ranges with offset and limit parameters.
Instructions
Reads a file and returns its contents with line numbers. Encoding-aware: auto-detects file encoding (UTF-8, EUC-KR, Shift-JIS, etc.). Image files (PNG, JPG, GIF, BMP, WebP, TIFF, ICO) are returned as ImageContent (base64). SVG files are returned as text. Supports offset/limit for reading specific line ranges. Negative offset reads from end (e.g. offset=-5 reads last 5 lines). Offset accepts integer, string range "100-200", or [start, end] array.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the file to read | |
| offset | No | Line offset. Integer (1-based, negative=from end), string range 'start-end', or [start,end] array. Default: 0 (all) | |
| limit | No | Maximum number of lines to read. Default: 0 (all) |