File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -74,18 +74,9 @@ export abstract class ToolBase {
7474 return result ;
7575 } catch ( error : unknown ) {
7676 logger . error ( mongoLogId ( 1_000_000 ) , "tool" , `Error executing ${ this . name } : ${ error as string } ` ) ;
77-
78- const toolResult : CallToolResult = {
79- isError : true ,
80- content : [
81- {
82- type : "text" ,
83- text : `Error running ${ this . name } : ${ error instanceof Error ? error . message : String ( error ) } ` ,
84- } ,
85- ] ,
86- } ;
87- await this . emitToolEvent ( startTime , toolResult ) ;
88- return await this . handleError ( error , args [ 0 ] as ToolArgs < typeof this . argsShape > ) ;
77+ const toolResult = await this . handleError ( error , args [ 0 ] as ToolArgs < typeof this . argsShape > ) ;
78+ await this . emitToolEvent ( startTime , toolResult ) . catch ( ( ) => { } ) ;
79+ return toolResult ;
8980 }
9081 } ;
9182
@@ -129,7 +120,6 @@ export abstract class ToolBase {
129120 text : `Error running ${ this . name } : ${ error instanceof Error ? error . message : String ( error ) } ` ,
130121 } ,
131122 ] ,
132- isError : true ,
133123 } ;
134124 }
135125}
You can’t perform that action at this time.
0 commit comments