Roo-Code/src/core/prompts
Daniel 0851769450
Improve read_file tool description with examples (#9422)
* Improve read_file tool description with examples

- Add explicit JSON structure documentation
- Include three concrete examples (single file, with line ranges, multiple files)
- Clarify that 'path' is required and 'line_ranges' is optional
- Better explain line range format (1-based inclusive)

This addresses agent confusion by providing clear examples similar to the XML tool definition.

* Make read_file tool dynamic based on partialReadsEnabled setting

- Convert read_file from static export to createReadFileTool() factory function
- Add getNativeTools() function that accepts partialReadsEnabled parameter
- Create buildNativeToolsArray() helper to encapsulate tool building logic
- Update Task.ts to build native tools dynamically using maxReadFileLine setting
- When partialReadsEnabled is false, line_ranges parameter is excluded from schema
- Examples and descriptions adjust based on whether line ranges are supported

This matches the behavior of the XML tool definition which dynamically adjusts
its documentation based on settings, reducing confusion for agents.
2025-11-20 07:21:48 -05:00
..
__tests__ feat: implement dynamic tool protocol resolution with proper precedence hierarchy (#9286) 2025-11-15 14:35:04 -05:00
instructions fix(modes): custom modes under custom path not showing (#8499) 2025-10-28 19:36:56 -04:00
sections fix: exclude XML tool examples from MODES section when native protocol enabled (#9367) 2025-11-18 15:48:37 -05:00
tools Improve read_file tool description with examples (#9422) 2025-11-20 07:21:48 -05:00
responses.ts fix: Update tools to return structured JSON for native protocol (#9373) 2025-11-18 20:01:15 -05:00
system.ts fix: Update tools to return structured JSON for native protocol (#9373) 2025-11-18 20:01:15 -05:00
types.ts fix: Filter native tools by mode restrictions (#9246) 2025-11-13 20:50:57 -05:00