Skip to content

Commit a5fd735

Browse files
committed
fix: change tool status to match Actor run status
1 parent 3f0d09d commit a5fd735

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/mcp/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,14 +683,14 @@ Please check the tool's input schema using ${HelperTools.ACTOR_GET_DETAILS} tool
683683
mcp_session_id: mcpSessionId || '',
684684
transport_type: this.options.transportType || '',
685685
tool_name: toolFullName,
686-
tool_status: 'success', // Will be updated in finally
686+
tool_status: 'succeeded', // Will be updated in finally
687687
tool_exec_time_ms: 0, // Will be calculated in finally
688688
tool_call_number: toolCallNumber,
689689
};
690690
}
691691

692692
const startTime = Date.now();
693-
let toolStatus: 'success' | 'failure' | 'cancelled' = 'success';
693+
let toolStatus: 'succeeded' | 'failed' | 'aborted' = 'succeeded';
694694

695695
try {
696696
// Handle internal tool
@@ -794,7 +794,7 @@ Please verify the server URL is correct and accessible, and ensure you have a va
794794
);
795795

796796
if (!callResult) {
797-
toolStatus = 'cancelled';
797+
toolStatus = 'aborted';
798798
// Receivers of cancellation notifications SHOULD NOT send a response for the cancelled request
799799
// https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/cancellation#behavior-requirements
800800
return { };
@@ -809,7 +809,7 @@ Please verify the server URL is correct and accessible, and ensure you have a va
809809
}
810810
}
811811
} catch (error) {
812-
toolStatus = extra.signal?.aborted ? 'cancelled' : 'failure';
812+
toolStatus = extra.signal?.aborted ? 'aborted' : 'failed';
813813
logHttpError(error, 'Error occurred while calling tool', { toolName: name });
814814
const errorMessage = (error instanceof Error) ? error.message : 'Unknown error';
815815
return buildMCPResponse([

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export interface ToolCallTelemetryProperties {
307307
mcp_session_id: string;
308308
transport_type: string;
309309
tool_name: string;
310-
tool_status: 'success' | 'failure' | 'cancelled';
310+
tool_status: 'succeeded' | 'failed' | 'aborted';
311311
tool_exec_time_ms: number;
312312
tool_call_number: number;
313313
}

tests/unit/telemetry.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('telemetry', () => {
2828
mcp_session_id: 'session-123',
2929
transport_type: 'stdio',
3030
tool_name: 'test-tool',
31-
tool_status: 'success' as const,
31+
tool_status: 'succeeded' as const,
3232
tool_exec_time_ms: 100,
3333
tool_call_number: 1,
3434
};
@@ -48,7 +48,7 @@ describe('telemetry', () => {
4848
mcp_session_id: 'session-123',
4949
transport_type: 'stdio',
5050
tool_name: 'test-tool',
51-
tool_status: 'success',
51+
tool_status: 'succeeded',
5252
tool_exec_time_ms: 100,
5353
tool_call_number: 1,
5454
},

0 commit comments

Comments
 (0)