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

mongodb-js / mongodb-mcp-server / 14599304051

22 Apr 2025 04:00PM UTC coverage: 76.792% (+23.6%) from 53.208%
14599304051

Pull #83

github

fmenezes
fix: tests
Pull Request #83: chore: add atlas tests

78 of 148 branches covered (52.7%)

Branch coverage included in aggregate %.

26 of 34 new or added lines in 5 files covered. (76.47%)

1 existing line in 1 file now uncovered.

554 of 675 relevant lines covered (82.07%)

27.25 hits per line

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

85.71
/src/tools/atlas/listOrgs.ts
1
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
import { AtlasToolBase } from "./atlasTool.js";
16✔
3
import { OperationType } from "../tool.js";
4

5
export class ListOrganizationsTool extends AtlasToolBase {
16✔
6
    protected name = "atlas-list-orgs";
16✔
7
    protected description = "List MongoDB Atlas organizations";
16✔
8
    protected operationType: OperationType = "read";
16✔
9
    protected argsShape = {};
16✔
10

11
    protected async execute(): Promise<CallToolResult> {
12
        this.session.ensureAuthenticated();
1✔
13

14
        const data = await this.session.apiClient.listOrganizations();
1✔
15

16
        if (!data?.results?.length) {
1!
NEW
17
            throw new Error("No projects found in your MongoDB Atlas account.");
×
18
        }
19

20
        // Format projects as a table
21
        const output =
22
            `Organization Name | Organization ID
1✔
23
----------------| ----------------
24
` +
25
            data.results
26
                .map((org) => {
27
                    return `${org.name} | ${org.id}`;
1✔
28
                })
29
                .join("\n");
30
        return {
1✔
31
            content: [{ type: "text", text: output }],
32
        };
33
    }
34
}
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