@@ -65,7 +65,7 @@ export class ConnectClusterTool extends AtlasToolBase {
65
65
private async prepareClusterConnection (
66
66
projectId : string ,
67
67
clusterName : string
68
- ) : Promise < [ string , AtlasClusterConnectionInfo ] > {
68
+ ) : Promise < { connectionString : string ; atlas : AtlasClusterConnectionInfo } > {
69
69
const cluster = await inspectCluster ( this . session . apiClient , projectId , clusterName ) ;
70
70
71
71
if ( ! cluster . connectionString ) {
@@ -124,7 +124,8 @@ export class ConnectClusterTool extends AtlasToolBase {
124
124
cn . username = username ;
125
125
cn . password = password ;
126
126
cn . searchParams . set ( "authSource" , "admin" ) ;
127
- return [ cn . toString ( ) , connectedAtlasCluster ] ;
127
+
128
+ return { connectionString : cn . toString ( ) , atlas : connectedAtlasCluster } ;
128
129
}
129
130
130
131
private async connectToCluster (
@@ -229,7 +230,7 @@ export class ConnectClusterTool extends AtlasToolBase {
229
230
case "disconnected" :
230
231
default : {
231
232
await this . session . disconnect ( ) ;
232
- const [ connectionString , atlas ] = await this . prepareClusterConnection ( projectId , clusterName ) ;
233
+ const { connectionString, atlas } = await this . prepareClusterConnection ( projectId , clusterName ) ;
233
234
234
235
// try to connect for about 5 minutes asynchronously
235
236
void this . connectToCluster ( projectId , clusterName , connectionString , atlas ) . catch (
0 commit comments