@@ -85,26 +85,97 @@ The tool uses a clear decision hierarchy to determine how to read a file:
8585
8686## Usage Examples
8787
88- Reading an entire file:
89- ```
88+ Here are several scenarios demonstrating how the ` read_file ` tool is used and the typical output you might receive.
89+
90+ ### Reading an Entire File
91+
92+ To read the complete content of a file:
93+
94+ ** Input:**
95+ ``` xml
9096<read_file >
9197<path >src/app.js</path >
9298</read_file >
9399```
94100
95- Reading specific lines (46-68) of a file:
101+ ** Simulated Output (for a small file like ` example_small.txt ` ):**
102+ ```
103+ 1 | This is the first line.
104+ 2 | This is the second line.
105+ 3 | This is the third line.
96106```
107+ * (Output will vary based on the actual file content)*
108+
109+ ### Reading Specific Lines
110+
111+ To read only a specific range of lines (e.g., 46-68):
112+
113+ ** Input:**
114+ ``` xml
97115<read_file >
98116<path >src/app.js</path >
99117<start_line >46</start_line >
100118<end_line >68</end_line >
101119</read_file >
102120```
103121
104- Reading a large file with auto-truncation:
122+ ** Simulated Output (for lines 2-3 of ` example_five_lines.txt ` ):**
123+ ```
124+ 2 | Content of line two.
125+ 3 | Content of line three.
105126```
127+ * (Output shows only the requested lines with their original line numbers)*
128+
129+ ### Reading a Large File (Auto-Truncation)
130+
131+ When reading a large file without specifying lines and ` auto_truncate ` is enabled (or defaults to true based on settings):
132+
133+ ** Input:**
134+ ``` xml
106135<read_file >
107136<path >src/large-module.js</path >
108- <auto_truncate>true</auto_truncate>
137+ <auto_truncate >true</auto_truncate > <!-- Optional if default is true -->
109138</read_file >
110139```
140+
141+ ** Simulated Output (for ` large_file.log ` with 1500 lines, limit 1000):**
142+ ```
143+ 1 | Log entry 1...
144+ 2 | Log entry 2...
145+ ...
146+ 1000 | Log entry 1000...
147+ [... truncated 500 lines ...]
148+ ```
149+ * (Output is limited to the configured maximum lines, with a truncation notice)*
150+
151+ ### Attempting to Read a Non-Existent File
152+
153+ If the specified file does not exist:
154+
155+ ** Input:**
156+ ``` xml
157+ <read_file >
158+ <path >non_existent_file.txt</path >
159+ </read_file >
160+ ```
161+
162+ ** Simulated Output (Error):**
163+ ```
164+ Error: File not found at path 'non_existent_file.txt'.
165+ ```
166+
167+ ### Attempting to Read a Blocked File
168+
169+ If the file is excluded by rules in a ` .rooignore ` file:
170+
171+ ** Input:**
172+ ``` xml
173+ <read_file >
174+ <path >.env</path >
175+ </read_file >
176+ ```
177+
178+ ** Simulated Output (Error):**
179+ ```
180+ Error: Access denied to file '.env' due to .rooignore rules.
181+ ```
0 commit comments