@@ -8,7 +8,8 @@ import { ensureCurrentIpInAccessList } from "../../../common/atlas/accessListUti
88import type { AtlasClusterConnectionInfo } from "../../../common/connectionManager.js" ;
99import { getDefaultRoleFromConfig } from "../../../common/atlas/roles.js" ;
1010import { AtlasArgs } from "../../args.js" ;
11- import { ConnectionMetadata } from "../../../telemetry/types.js" ;
11+ import type { ConnectionMetadata } from "../../../telemetry/types.js" ;
12+ import type { ToolCallback } from "@modelcontextprotocol/sdk/server/mcp.js" ;
1213
1314const addedIpAccessListMessage =
1415 "Note: Your current IP address has been added to the Atlas project's IP access list to enable secure connection." ;
@@ -305,18 +306,13 @@ export class ConnectClusterTool extends AtlasToolBase {
305306 return { content } ;
306307 }
307308
308- // eslint-disable-next-line @typescript-eslint/no-unused-vars
309- protected override resolveTelemetryMetadata ( _args : ToolArgs < typeof this . argsShape > ) : ConnectionMetadata {
310- const metadata : ConnectionMetadata = { } ;
311- const connectionStringAuthType = this . session . connectionManager . currentConnectionState . connectionStringAuthType ;
312- if ( connectionStringAuthType ) {
313- metadata . connection_auth_type = connectionStringAuthType ;
314- }
315-
316- if ( this . session . connectedAtlasCluster ?. projectId ) {
317- metadata . project_id = this . session . connectedAtlasCluster . projectId ;
318- }
319-
320- return metadata ;
309+ protected override resolveTelemetryMetadata (
310+ result : CallToolResult ,
311+ args : Parameters < ToolCallback < typeof this . argsShape > >
312+ ) : ConnectionMetadata {
313+ return {
314+ ...super . resolveTelemetryMetadata ( result , ...args ) ,
315+ ...this . getConnectionInfoMetadata ( ) ,
316+ } ;
321317 }
322318}
0 commit comments