diff --git a/src/mcp/server.ts b/src/mcp/server.ts index 6f10614..a9f1828 100644 --- a/src/mcp/server.ts +++ b/src/mcp/server.ts @@ -781,7 +781,7 @@ Please verify the tool name and ensure the tool is properly registered.`; mcp_client_name: params?.clientInfo?.name || '', mcp_client_version: params?.clientInfo?.version || '', mcp_protocol_version: params?.protocolVersion || '', - mcp_client_capabilities: capabilities ? JSON.stringify(capabilities) : '', + mcp_client_capabilities: capabilities || null, mcp_session_id: mcpSessionId || '', transport_type: this.options.transportType || '', tool_name: toolFullName, diff --git a/src/types.ts b/src/types.ts index d660d46..77bfef5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -303,7 +303,7 @@ export interface ToolCallTelemetryProperties { mcp_client_name: string; mcp_client_version: string; mcp_protocol_version: string; - mcp_client_capabilities: string; + mcp_client_capabilities: Record | null; mcp_session_id: string; transport_type: string; tool_name: string; diff --git a/tests/unit/telemetry.test.ts b/tests/unit/telemetry.test.ts index 5a10535..260c86b 100644 --- a/tests/unit/telemetry.test.ts +++ b/tests/unit/telemetry.test.ts @@ -23,7 +23,7 @@ describe('telemetry', () => { mcp_client_name: 'test-client', mcp_client_version: '1.0.0', mcp_protocol_version: '2024-11-05', - mcp_client_capabilities: '{}', + mcp_client_capabilities: {}, mcp_session_id: 'session-123', transport_type: 'stdio', tool_name: 'test-tool', @@ -42,7 +42,7 @@ describe('telemetry', () => { mcp_client_name: 'test-client', mcp_client_version: '1.0.0', mcp_protocol_version: '2024-11-05', - mcp_client_capabilities: '{}', + mcp_client_capabilities: {}, mcp_session_id: 'session-123', transport_type: 'stdio', tool_name: 'test-tool', @@ -59,7 +59,7 @@ describe('telemetry', () => { mcp_client_name: 'test-client', mcp_client_version: '1.0.0', mcp_protocol_version: '2024-11-05', - mcp_client_capabilities: '{}', + mcp_client_capabilities: {}, mcp_session_id: 'session-123', transport_type: 'stdio', tool_name: 'test-tool',