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

mongodb-js / mongodb-mcp-server / 14618487127

23 Apr 2025 12:45PM UTC coverage: 78.42% (+1.7%) from 76.675%
14618487127

Pull #91

github

nirinchev
PR comments
Pull Request #91: chore: add tests for metadata actions

90 of 161 branches covered (55.9%)

Branch coverage included in aggregate %.

22 of 23 new or added lines in 4 files covered. (95.65%)

30 existing lines in 12 files now uncovered.

575 of 687 relevant lines covered (83.7%)

30.41 hits per line

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

80.0
/src/tools/atlas/inspectAccessList.ts
1
import { z } from "zod";
18✔
2
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
import { AtlasToolBase } from "./atlasTool.js";
18✔
4
import { ToolArgs, OperationType } from "../tool.js";
5

6
export class InspectAccessListTool extends AtlasToolBase {
18✔
7
    protected name = "atlas-inspect-access-list";
18✔
8
    protected description = "Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.";
18✔
9
    protected operationType: OperationType = "read";
18✔
10
    protected argsShape = {
18✔
11
        projectId: z.string().describe("Atlas project ID"),
12
    };
13

14
    protected async execute({ projectId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
15
        this.session.ensureAuthenticated();
1✔
16

17
        const accessList = await this.session.apiClient.listProjectIpAccessLists({
18
            params: {
19
                path: {
20
                    groupId: projectId,
21
                },
22
            },
23
        });
1!
UNCOV
24

×
25
        if (!accessList?.results?.length) {
26
            throw new Error("No access list entries found.");
27
        }
1✔
28

29
        return {
30
            content: [
31
                {
32
                    type: "text",
33
                    text: `IP ADDRESS | CIDR | COMMENT
1!
34
------|------|------
35
${(accessList.results || [])
5✔
36
    .map((entry) => {
37
        return `${entry.ipAddress} | ${entry.cidrBlock} | ${entry.comment}`;
38
    })
39
    .join("\n")}`,
40
                },
41
            ],
42
        };
43
    }
44
}
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