Skip to content

Commit 765fdf5

Browse files
committed
fix: do not log mcp_client_capabilities as JSON -> use object
1 parent fa8f421 commit 765fdf5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/mcp/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ Please verify the tool name and ensure the tool is properly registered.`;
781781
mcp_client_name: params?.clientInfo?.name || '',
782782
mcp_client_version: params?.clientInfo?.version || '',
783783
mcp_protocol_version: params?.protocolVersion || '',
784-
mcp_client_capabilities: capabilities ? JSON.stringify(capabilities) : '',
784+
mcp_client_capabilities: capabilities || null,
785785
mcp_session_id: mcpSessionId || '',
786786
transport_type: this.options.transportType || '',
787787
tool_name: toolFullName,

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export interface ToolCallTelemetryProperties {
303303
mcp_client_name: string;
304304
mcp_client_version: string;
305305
mcp_protocol_version: string;
306-
mcp_client_capabilities: string;
306+
mcp_client_capabilities: Record<string, unknown> | null;
307307
mcp_session_id: string;
308308
transport_type: string;
309309
tool_name: string;

tests/unit/telemetry.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('telemetry', () => {
2323
mcp_client_name: 'test-client',
2424
mcp_client_version: '1.0.0',
2525
mcp_protocol_version: '2024-11-05',
26-
mcp_client_capabilities: '{}',
26+
mcp_client_capabilities: {},
2727
mcp_session_id: 'session-123',
2828
transport_type: 'stdio',
2929
tool_name: 'test-tool',
@@ -42,7 +42,7 @@ describe('telemetry', () => {
4242
mcp_client_name: 'test-client',
4343
mcp_client_version: '1.0.0',
4444
mcp_protocol_version: '2024-11-05',
45-
mcp_client_capabilities: '{}',
45+
mcp_client_capabilities: {},
4646
mcp_session_id: 'session-123',
4747
transport_type: 'stdio',
4848
tool_name: 'test-tool',
@@ -59,7 +59,7 @@ describe('telemetry', () => {
5959
mcp_client_name: 'test-client',
6060
mcp_client_version: '1.0.0',
6161
mcp_protocol_version: '2024-11-05',
62-
mcp_client_capabilities: '{}',
62+
mcp_client_capabilities: {},
6363
mcp_session_id: 'session-123',
6464
transport_type: 'stdio',
6565
tool_name: 'test-tool',

0 commit comments

Comments
 (0)