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

mongodb-js / mongodb-mcp-server / 17159941478

22 Aug 2025 03:54PM UTC coverage: 81.682% (-0.3%) from 82.022%
17159941478

Pull #465

github

web-flow
Merge 9874379ed into 99a9b6a04
Pull Request #465: fix: wrap more tool responses in untrusted-user-data tags

852 of 1073 branches covered (79.4%)

Branch coverage included in aggregate %.

98 of 119 new or added lines in 17 files covered. (82.35%)

12 existing lines in 6 files now uncovered.

4343 of 5287 relevant lines covered (82.14%)

70.39 hits per line

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

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

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

12
    protected async execute(): Promise<CallToolResult> {
2✔
13
        const data = await this.session.apiClient.listOrganizations();
1✔
14

15
        if (!data?.results?.length) {
1!
NEW
16
            return {
×
NEW
17
                content: [{ type: "text", text: "No organizations found in your MongoDB Atlas account." }],
×
NEW
18
            };
×
UNCOV
19
        }
×
20

21
        // Format organizations as a table
22
        const output =
1✔
23
            `Organization Name | Organization ID
1✔
24
----------------| ----------------
25
` +
26
            data.results
1✔
27
                .map((org) => {
1✔
28
                    return `${org.name} | ${org.id}`;
1✔
29
                })
1✔
30
                .join("\n");
1✔
31
        return {
1✔
32
            content: formatUntrustedData(
1✔
33
                `Found ${data.results.length} organizations in your MongoDB Atlas account.`,
1✔
34
                output
1✔
35
            ),
1✔
36
        };
1✔
37
    }
1✔
38
}
2✔
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