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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"absolute_file_path": "<absolute_file_path>"
},
"name": "read_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Reading mode: 'lines' (by range), 'semantic' (tree-sitter chunks), 'tail' (last N), 'head' (first N) | lines |
| limit | No | Lines to return (default 100). Reduce for files with long lines (check get_overview). | |
| offset | No | Starting line number, 1-indexed (default: 1). Ignored in tail/head modes. | |
| pattern | No | Pattern to position read (finds match, then reads around it). Overrides offset. | |
| absolute_file_path | Yes | Absolute path to target file |