get_chunk
Reads an inclusive line range from a UTF-8 file without modifying it, so you can inspect findings or gather context for a patch. Returns source text and clamped line boundaries.
Instructions
Read an inclusive line range from a UTF-8 file without modifying it. Use when: you need to inspect a finding or obtain context for a patch. Don't use when: you need repository-wide findings (use scan_repo instead).
Returns {source, language, start_line, end_line, total_lines} on success, or {error} on failure. Source joins the selected lines with newlines; start_line/end_line report the clamped inclusive range. Large files can be read in slices; binary, lock and minified-file guards still apply.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_line | No | Last line, 1-indexed and inclusive; default null reads through EOF. An inverted range returns the start line; values beyond EOF clamp to EOF. | |
| file_path | Yes | UTF-8 text file to read, e.g. /work/app/src/main.py. Relative paths resolve from the server working directory, not repo_root; the resolved file must remain inside repo_root. Binary/lock/minified files are skipped. | |
| repo_root | No | Repository boundary used to validate file_path. Default null uses the server working directory; prefer an absolute path, e.g. /work/app. | |
| start_line | No | First line, 1-indexed and inclusive; default 1. Values below 1 clamp to 1; a request beyond EOF returns the last line. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| source | No | ||
| end_line | No | ||
| language | No | ||
| start_line | No | ||
| total_lines | No |