fix: always include line_range in read_file tool description

The tool description now always includes line_range information regardless
of the partialReadsEnabled setting. This fixes an issue where files could
be truncated due to context/token budget limits but the tool description
would not mention line_range if maxReadFileLine was set to -1 (unlimited).

This ensures models always know how to continue reading truncated files,
whether the truncation was due to line limits or context budget constraints.
This commit is contained in:
Roo Code 2025-12-20 22:23:31 +00:00
parent 756cbfcf28
commit 8c1d360fc6
14 changed files with 170 additions and 104 deletions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -32,10 +32,11 @@ Description: Request to read the contents of one or more files. The tool outputs
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
@ -90,7 +91,7 @@ IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -27,22 +27,23 @@ Always use the actual tool name as the XML tag name for proper parsing and execu
# Tools
## read_file
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
**IMPORTANT: You can read a maximum of 5 files in a single request.** If you need to read more files, use multiple sequential read_file requests.
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory /test/path)
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -54,7 +55,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -64,11 +65,12 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
<line_range>10-20</line_range>
</file>
</args>
</read_file>
@ -85,7 +87,11 @@ Examples:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- You MUST read all related files and implementations together in a single operation (up to 5 files at once)
- You MUST obtain all necessary context before proceeding with changes
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
- When you need to read more than 5 files, prioritize the most critical files first, then use subsequent read_file requests for additional files
## fetch_instructions

View file

@ -5,22 +5,23 @@ export function getReadFileDescription(args: ToolArgs): string {
const isMultipleReadsEnabled = maxConcurrentReads > 1
return `## read_file
Description: Request to read the contents of ${isMultipleReadsEnabled ? "one or more files" : "a file"}. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code.${args.partialReadsEnabled ? " Use line ranges to efficiently read specific portions of large files." : ""} Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
Description: Request to read the contents of ${isMultipleReadsEnabled ? "one or more files" : "a file"}. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
${isMultipleReadsEnabled ? `**IMPORTANT: You can read a maximum of ${maxConcurrentReads} files in a single request.** If you need to read more files, use multiple sequential read_file requests.` : "**IMPORTANT: Multiple file reads are currently disabled. You can only read one file at a time.**"}
${args.partialReadsEnabled ? `By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.` : ""}
By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.
Parameters:
- args: Contains one or more file elements, where each file contains:
- path: (required) File path (relative to workspace directory ${args.cwd})
${args.partialReadsEnabled ? `- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive)` : ""}
- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive). Use this to read specific sections of a file, especially useful for continuing to read a large file that was truncated.
Usage:
<read_file>
<args>
<file>
<path>path/to/file</path>
${args.partialReadsEnabled ? `<line_range>start-end</line_range>` : ""}
<line_range>start-end</line_range>
</file>
</args>
</read_file>
@ -32,7 +33,7 @@ Examples:
<args>
<file>
<path>src/app.ts</path>
${args.partialReadsEnabled ? `<line_range>1-1000</line_range>` : ""}
<line_range>1-1000</line_range>
</file>
</args>
</read_file>
@ -44,16 +45,12 @@ ${isMultipleReadsEnabled ? `2. Reading multiple files (within the ${maxConcurren
<args>
<file>
<path>src/app.ts</path>
${
args.partialReadsEnabled
? `<line_range>1-50</line_range>
<line_range>100-150</line_range>`
: ""
}
<line_range>1-50</line_range>
<line_range>100-150</line_range>
</file>
<file>
<path>src/utils.ts</path>
${args.partialReadsEnabled ? `<line_range>10-20</line_range>` : ""}
<line_range>10-20</line_range>
</file>
</args>
</read_file>`
@ -72,14 +69,10 @@ ${isMultipleReadsEnabled ? "3. " : "2. "}Reading an entire file:
IMPORTANT: You MUST use this Efficient Reading Strategy:
- ${isMultipleReadsEnabled ? `You MUST read all related files and implementations together in a single operation (up to ${maxConcurrentReads} files at once)` : "You MUST read files one at a time, as multiple file reads are currently disabled"}
- You MUST obtain all necessary context before proceeding with changes
${
args.partialReadsEnabled
? `- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST use line ranges to read specific portions of large files, rather than reading entire files when not needed
- You MUST combine adjacent line ranges (<10 lines apart)
- You MUST use multiple ranges for content separated by >10 lines
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
`
: ""
}
- When a file is too large to display completely, the tool will show a truncation notice with the exact line number to continue from. Use the line_range parameter to read the next section of the file.
${isMultipleReadsEnabled ? `- When you need to read more than ${maxConcurrentReads} files, prioritize the most critical files first, then use subsequent read_file requests for additional files` : ""}`
}