• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mongodb-js / mongodb-mcp-server / 16123662219

07 Jul 2025 05:25PM UTC coverage: 60.879% (-13.3%) from 74.187%
16123662219

Pull #343

github

web-flow
Merge 24298edad into 5b7ba55e0
Pull Request #343: fix: turn atlas-connect-cluster async

183 of 411 branches covered (44.53%)

Branch coverage included in aggregate %.

0 of 34 new or added lines in 1 file covered. (0.0%)

129 existing lines in 15 files now uncovered.

704 of 1046 relevant lines covered (67.3%)

59.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.14
/src/tools/atlas/create/createFreeCluster.ts
1
import { z } from "zod";
2
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
import { AtlasToolBase } from "../atlasTool.js";
4
import { ToolArgs, OperationType } from "../../tool.js";
5
import { ClusterDescription20240805 } from "../../../common/atlas/openapi.js";
6

7
export class CreateFreeClusterTool extends AtlasToolBase {
8
    protected name = "atlas-create-free-cluster";
33✔
9
    protected description = "Create a free MongoDB Atlas cluster";
33✔
10
    protected operationType: OperationType = "create";
33✔
11
    protected argsShape = {
33✔
12
        projectId: z.string().describe("Atlas project ID to create the cluster in"),
13
        name: z.string().describe("Name of the cluster"),
14
        region: z.string().describe("Region of the cluster").default("US_EAST_1"),
15
    };
16

17
    protected async execute({ projectId, name, region }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
UNCOV
18
        const input = {
×
19
            groupId: projectId,
20
            name,
21
            clusterType: "REPLICASET",
22
            replicationSpecs: [
23
                {
24
                    zoneName: "Zone 1",
25
                    regionConfigs: [
26
                        {
27
                            providerName: "TENANT",
28
                            backingProviderName: "AWS",
29
                            regionName: region,
30
                            electableSpecs: {
31
                                instanceSize: "M0",
32
                            },
33
                        },
34
                    ],
35
                },
36
            ],
37
            terminationProtectionEnabled: false,
38
        } as unknown as ClusterDescription20240805;
39

UNCOV
40
        await this.session.apiClient.createCluster({
×
41
            params: {
42
                path: {
43
                    groupId: projectId,
44
                },
45
            },
46
            body: input,
47
        });
48

UNCOV
49
        return {
×
50
            content: [
51
                { type: "text", text: `Cluster "${name}" has been created in region "${region}".` },
52
                { type: "text", text: `Double check your access lists to enable your current IP.` },
53
            ],
54
        };
55
    }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc