@@ -48,7 +48,7 @@ export const createFileEditInsertTool: ToolFactory = (config: ToolConfiguration)
4848 description : TOOL_DEFINITIONS . file_edit_insert . description ,
4949 inputSchema : TOOL_DEFINITIONS . file_edit_insert . schema ,
5050 execute : async (
51- { file_path, content, before, after, create } : FileEditInsertToolArgs ,
51+ { file_path, content, before, after } : FileEditInsertToolArgs ,
5252 { abortSignal }
5353 ) : Promise < FileEditInsertToolResult > => {
5454 try {
@@ -71,14 +71,6 @@ export const createFileEditInsertTool: ToolFactory = (config: ToolConfiguration)
7171 const exists = await fileExists ( config . runtime , resolvedPath , abortSignal ) ;
7272
7373 if ( ! exists ) {
74- if ( ! create ) {
75- return {
76- success : false ,
77- error : `File not found: ${ file_path } . Set create: true to create it.` ,
78- note : `${ EDIT_FAILED_NOTE_PREFIX } File does not exist. Set create: true to create it, or check the file path.` ,
79- } ;
80- }
81-
8274 try {
8375 await writeFileString ( config . runtime , resolvedPath , content , abortSignal ) ;
8476 } catch ( err ) {
@@ -139,7 +131,7 @@ function insertContent(
139131 }
140132
141133 if ( before === undefined && after === undefined ) {
142- return guardFailure ( "Provide either a before or after guard to anchor the insertion point ." ) ;
134+ return guardFailure ( "Provide either a before or after guard when editing existing files ." ) ;
143135 }
144136
145137 return insertWithGuards ( originalContent , contentToInsert , { before, after } ) ;
0 commit comments