Skip to content

Commit 92815f8

Browse files
committed
refactor: Update readFileTool to return results in XML format
Modifies the `readFileTool` function to format the output as XML, enhancing the structure of the returned file content. This change aligns with previous updates to ensure consistent result formatting across tools.
1 parent 73da4d0 commit 92815f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/tools/readFileTool.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ export async function readFileTool(
171171
content += `\n\n[Showing only ${maxReadFileLine} of ${totalLines} total lines. Use start_line and end_line if you need to read more]${sourceCodeDef}`
172172
}
173173

174-
pushToolResult(content)
174+
// Format the result into the required XML structure
175+
const xmlResult = `<file>\n <path>${relPath}</path>\n <content>\n${content}\n </content>\n</file>`
176+
pushToolResult(xmlResult)
175177
}
176178
} catch (error) {
177179
await handleError("reading file", error)

0 commit comments

Comments
 (0)