Skip to content

Commit 1d8c0a7

Browse files
committed
fix(text_editor.py): update error message for content hash mismatch to provide clearer instructions for appending content
1 parent bce5984 commit 1d8c0a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp_text_editor/text_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ async def edit_file_contents(
396396
if actual_range_hash != expected_range_hash:
397397
return {
398398
"result": "error",
399-
"reason": f"Content hash mismatch - file has been modified since last read. Please use get_text_file_contents tool with lines {line_start}-{line_end} to get current content and hashes, then retry with the updated hashes. Expected: {expected_range_hash}, Actual: {actual_range_hash}. Content: {target_content!r}",
399+
"reason": f"Content hash mismatch - file has been modified since last read. Please use get_text_file_contents tool with lines {line_start}-{line_end} to get current content and hashes, then retry with the updated hashes. If you want to append content, set line_start to {len(lines)+1}.",
400400
"file_hash": None,
401401
"content": current_content,
402402
}

0 commit comments

Comments
 (0)