read
Access file contents for text and media files. Manage line limits and offsets to prevent token overflow when processing large documents.
Instructions
Reads the contents of a file. Supports text files and media files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to the file to read. | |
| type | Yes | The type of content to read. `text` for text files, `media` for media files. | |
| limit | No | The maximum number of lines to read. Useful for preventing token overflow when reading very large text files. Ignored for media files. Defaults to `100` if not specified. | |
| offset | No | The number of lines to skip before starting to read. Used in combination with limit to paginate through large files. Ignored for media files. Defaults to `0` if not specified. | |
| show_line_numbers | No | Whether to prepend 1-indexed line numbers to each line (e.g., `1:`, `2:`). Setting this to `false` can save tokens when line numbers are strictly not needed. Ignored for media files. Defaults to `true` if not specified. |