Skip to content

Tool: get_lines

Description: Read lines from a file. Returns specific lines if a range is provided, or the entire file if no range is given. If both from_line and to_line are None, the entire file is returned in one call.

Argument Type Description
file_path str Path to the file to read lines from.
from_line int, optional Starting line number (1-based). If None, starts from the first line.
to_line int, optional Ending line number (1-based). If None, reads to the end of the file.
Returns str File content with a header indicating the file name and line range, or error message.

Example usage: get_lines(file_path="README.md", from_line=1, to_line=10)


generated by janito.dev