read_file
Read file content with line numbers by providing a file path, and optionally specify start and end lines to read a section of the file.
Instructions
Read content from a file with line numbers, validating the file path first.
Args:
file_path: Path to the file to read
start_line: Line number to start reading from (0-indexed, default: 0)
end_line: Line number to end reading at (0-indexed, inclusive, default: None for all lines)
Returns:
A string with numbered lines from the file
Raises:
FileNotFoundError: If the file does not exist
ValueError: If the line parameters are invalid
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": {
"file_path": "<file_path>"
},
"name": "read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| start_line | No | ||
| end_line | No |