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

mongodb-js / mongodb-mcp-server / 14733421831

29 Apr 2025 02:11PM UTC coverage: 68.999%. First build
14733421831

Pull #164

github

gagik
test
Pull Request #164: test: dependencies check

109 of 235 branches covered (46.38%)

Branch coverage included in aggregate %.

670 of 894 relevant lines covered (74.94%)

45.18 hits per line

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

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

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

14
    protected async execute({ projectId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
15
        const accessList = await this.session.apiClient.listProjectIpAccessLists({
×
16
            params: {
17
                path: {
18
                    groupId: projectId,
19
                },
20
            },
21
        });
22

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

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