read
Fetches file contents with line numbers and encoding detection. Use offset/limit to retrieve specific line ranges; images are returned as base64.
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. Text defaults to 400 lines and 32768 characters; use offset/limit to continue. Every text result ends with total line count, truncation state, and next_offset when more is available. Negative offset reads from end (e.g. offset=-5 reads last 5 lines). Offset accepts integer, string range "100-200", or [start, end] array. Accepts "path" as alias for "file_path". Relative paths use the configured workspace, MCP client root, or server CWD in that order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Remove the default line limit. The max_output_chars safety budget still applies. Default: false | |
| path | No | Compatibility alias for file_path; prefer file_path | |
| limit | No | Maximum lines to return. Default: 400. Set 0 or all=true to remove the line limit; the character budget still applies | |
| offset | No | Line offset. Integer (1-based, negative=from end), string range 'start-end', or [start,end] array. Default: 1 | |
| end_line | No | Inclusive end line used with start_line | |
| file_path | No | Absolute or workspace-relative path to the file to read | |
| start_line | No | Compatibility alias for offset; prefer offset | |
| include_hash | No | Include SHA-256 for optimistic edit concurrency. Default: true | |
| max_line_chars | No | Maximum characters returned from one line. Default: 4000, Max: 32768 | |
| max_output_chars | No | Maximum returned text characters. Default: 32768, Max: 131072 |