Skip to content

Commit 4730bfb

Browse files
reverted emitToolEvent to be sync again
1 parent 035d4c7 commit 4730bfb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/tools/tool.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export abstract class ToolBase {
162162
});
163163

164164
const result = await this.execute(...args);
165-
await this.emitToolEvent(startTime, result, ...args);
165+
this.emitToolEvent(startTime, result, ...args);
166166

167167
this.session.logger.debug({
168168
id: LogId.toolExecute,
@@ -178,7 +178,7 @@ export abstract class ToolBase {
178178
message: `Error executing ${this.name}: ${error as string}`,
179179
});
180180
const toolResult = await this.handleError(error, args[0] as ToolArgs<typeof this.argsShape>);
181-
await this.emitToolEvent(startTime, toolResult, ...args);
181+
this.emitToolEvent(startTime, toolResult, ...args);
182182
return toolResult;
183183
}
184184
};
@@ -280,24 +280,24 @@ export abstract class ToolBase {
280280
protected abstract resolveTelemetryMetadata(
281281
result: CallToolResult,
282282
...args: Parameters<ToolCallback<typeof this.argsShape>>
283-
): TelemetryToolMetadata | Promise<TelemetryToolMetadata>;
283+
): TelemetryToolMetadata;
284284

285285
/**
286286
* Creates and emits a tool telemetry event
287287
* @param startTime - Start time in milliseconds
288288
* @param result - Whether the command succeeded or failed
289289
* @param args - The arguments passed to the tool
290290
*/
291-
private async emitToolEvent(
291+
private emitToolEvent(
292292
startTime: number,
293293
result: CallToolResult,
294294
...args: Parameters<ToolCallback<typeof this.argsShape>>
295-
): Promise<void> {
295+
): void {
296296
if (!this.telemetry.isTelemetryEnabled()) {
297297
return;
298298
}
299299
const duration = Date.now() - startTime;
300-
const metadata = await this.resolveTelemetryMetadata(result, ...args);
300+
const metadata = this.resolveTelemetryMetadata(result, ...args);
301301
const event: ToolEvent = {
302302
timestamp: new Date().toISOString(),
303303
source: "mdbmcp",

0 commit comments

Comments
 (0)