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

mongodb-js / mongodb-mcp-server / 14672998392

25 Apr 2025 08:31PM UTC coverage: 82.446%. Remained the same
14672998392

Pull #137

github

nirinchev
Update name for fork workflow
Pull Request #137: chore: revamp gha workflows

135 of 212 branches covered (63.68%)

Branch coverage included in aggregate %.

748 of 859 relevant lines covered (87.08%)

48.14 hits per line

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

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

6
export class InspectAccessListTool extends AtlasToolBase {
31✔
7
    protected name = "atlas-inspect-access-list";
28✔
8
    protected description = "Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.";
28✔
9
    protected operationType: OperationType = "read";
28✔
10
    protected argsShape = {
28✔
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({
1✔
16
            params: {
17
                path: {
18
                    groupId: projectId,
19
                },
20
            },
21
        });
22

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

27
        return {
1✔
28
            content: [
29
                {
30
                    type: "text",
31
                    text: `IP ADDRESS | CIDR | COMMENT
32
------|------|------
33
${(accessList.results || [])
1!
34
    .map((entry) => {
35
        return `${entry.ipAddress} | ${entry.cidrBlock} | ${entry.comment}`;
5✔
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