@@ -46,7 +46,7 @@ export abstract class ToolBase {
46
46
logger . debug ( LogId . toolExecute , "tool" , `Executing ${ this . name } with args: ${ JSON . stringify ( args ) } ` ) ;
47
47
48
48
const result = await this . execute ( ...args ) ;
49
- await this . emitToolEvent ( startTime , result , ...args ) ;
49
+ await this . emitToolEvent ( startTime , result , ...args ) . catch ( ( ) => { } ) ;
50
50
return result ;
51
51
} catch ( error : unknown ) {
52
52
logger . error ( LogId . toolExecuteFailure , "tool" , `Error executing ${ this . name } : ${ error as string } ` ) ;
@@ -143,38 +143,33 @@ export abstract class ToolBase {
143
143
...args : Parameters < ToolCallback < typeof this . argsShape > >
144
144
) : TelemetryToolMetadata {
145
145
const toolMetadata : TelemetryToolMetadata = { } ;
146
- try {
147
- if ( ! args . length ) {
148
- return toolMetadata ;
149
- }
146
+ if ( ! args . length ) {
147
+ return toolMetadata ;
148
+ }
150
149
151
- // Create a typed parser for the exact shape we expect
152
- const argsShape = z . object ( this . argsShape ) ;
153
- const parsedResult = argsShape . safeParse ( args [ 0 ] ) ;
154
-
155
- if ( ! parsedResult . success ) {
156
- logger . debug (
157
- LogId . telmetryMetadataError ,
158
- "tool" ,
159
- `Error parsing tool arguments: ${ parsedResult . error . message } `
160
- ) ;
161
- return toolMetadata ;
162
- }
150
+ // Create a typed parser for the exact shape we expect
151
+ const argsShape = z . object ( this . argsShape ) ;
152
+ const parsedResult = argsShape . safeParse ( args [ 0 ] ) ;
163
153
164
- const data = parsedResult . data ;
154
+ if ( ! parsedResult . success ) {
155
+ logger . debug (
156
+ LogId . telmetryMetadataError ,
157
+ "tool" ,
158
+ `Error parsing tool arguments: ${ parsedResult . error . message } `
159
+ ) ;
160
+ return toolMetadata ;
161
+ }
165
162
166
- // Extract projectId using type guard
167
- if ( "projectId" in data && typeof data . projectId === "string" && data . projectId . trim ( ) !== "" ) {
168
- toolMetadata . projectId = data . projectId ;
169
- }
163
+ const data = parsedResult . data ;
170
164
171
- // Extract orgId using type guard
172
- if ( "orgId" in data && typeof data . orgId === "string" && data . orgId . trim ( ) !== "" ) {
173
- toolMetadata . orgId = data . orgId ;
174
- }
175
- } catch ( error ) {
176
- const errorMessage = error instanceof Error ? error . message : String ( error ) ;
177
- logger . debug ( LogId . telmetryMetadataError , "tool" , `Error resolving tool metadata: ${ errorMessage } ` ) ;
165
+ // Extract projectId using type guard
166
+ if ( "projectId" in data && typeof data . projectId === "string" && data . projectId . trim ( ) !== "" ) {
167
+ toolMetadata . projectId = data . projectId ;
168
+ }
169
+
170
+ // Extract orgId using type guard
171
+ if ( "orgId" in data && typeof data . orgId === "string" && data . orgId . trim ( ) !== "" ) {
172
+ toolMetadata . orgId = data . orgId ;
178
173
}
179
174
return toolMetadata ;
180
175
}
@@ -199,7 +194,6 @@ export abstract class ToolBase {
199
194
timestamp : new Date ( ) . toISOString ( ) ,
200
195
source : "mdbmcp" ,
201
196
properties : {
202
- ...this . telemetry . getCommonProperties ( ) ,
203
197
command : this . name ,
204
198
category : this . category ,
205
199
component : "tool" ,
0 commit comments