read_content
Read specific portions of large files by line range, tail, head, or semantic chunks. Use after search to examine content efficiently.
Instructions
Read specific portions of large files efficiently.
Use after search_content locates content, or directly with tail/head modes
for logs. Modes: 'lines' (read by offset/limit), 'semantic' (complete
functions/classes via Tree-sitter), 'tail' (last N lines - ideal for logs),
'head' (first N lines). Does NOT search - use search_content first to find
line numbers, then read_content to examine. For files over 500MB, tail/head
modes are most efficient.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| absolute_file_path | Yes | Absolute path to target file | |
| offset | No | Starting line number, 1-indexed (default: 1). Ignored in tail/head modes. | |
| limit | No | Lines to return (default 100). Reduce for files with long lines (check get_overview). | |
| pattern | No | Pattern to position read (finds match, then reads around it). Overrides offset. | |
| mode | No | Reading mode: 'lines' (by range), 'semantic' (tree-sitter chunks), 'tail' (last N), 'head' (first N) | lines |