Skip to content

Commit a18cbdb

Browse files
committed
Addresses copilot review
1 parent 933e18a commit a18cbdb

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/common/atlas/cluster.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,14 @@ export async function inspectCluster(apiClient: ApiClient, projectId: string, cl
114114
}
115115
}
116116

117-
// getConnectionString returns a connection string given a connectionType.
118-
// For "privateEndpoint", it returns the first private endpoint connection string available.
117+
/**
118+
* Returns a connection string for the specified connectionType.
119+
* For "privateEndpoint", it returns the first private endpoint connection string available.
120+
*/
119121
export function getConnectionString(
120122
connectionStrings: ClusterConnectionStrings,
121123
connectionType: "standard" | "private" | "privateEndpoint"
122124
): string | undefined {
123-
if (connectionStrings === undefined) {
124-
return undefined;
125-
}
126-
127125
switch (connectionType) {
128126
case "standard":
129127
return connectionStrings.standardSrv || connectionStrings.standard;

src/tools/atlas/connect/connectCluster.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ function sleep(ms: number): Promise<void> {
2222
export const ConnectClusterArgs = {
2323
projectId: AtlasArgs.projectId().describe("Atlas project ID"),
2424
clusterName: AtlasArgs.clusterName().describe("Atlas cluster name"),
25-
connectionType: AtlasArgs.connectionType()
26-
.optional()
27-
.describe("Type of connection (standard, private, or privateEndpoint) to an Atlas cluster"),
25+
connectionType: AtlasArgs.connectionType().describe(
26+
"Type of connection (standard, private, or privateEndpoint) to an Atlas cluster"
27+
),
2828
};
2929

3030
export class ConnectClusterTool extends AtlasToolBase {

0 commit comments

Comments
 (0)