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

mongodb-js / mongodb-mcp-server / 17161333946

22 Aug 2025 05:03PM UTC coverage: 81.909% (-0.1%) from 82.022%
17161333946

Pull #471

github

web-flow
Merge 903825dd4 into 49707be70
Pull Request #471: fix: atlas connectCluster defaults to readOnly DB roles - MCP-125

874 of 1092 branches covered (80.04%)

Branch coverage included in aggregate %.

25 of 25 new or added lines in 2 files covered. (100.0%)

49 existing lines in 10 files now uncovered.

4360 of 5298 relevant lines covered (82.3%)

70.64 hits per line

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

92.0
/src/tools/mongodb/metadata/listDatabases.ts
1
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
import { MongoDBToolBase } from "../mongodbTool.js";
2✔
3
import type * as bson from "bson";
4
import type { OperationType } from "../../tool.js";
5
import { formatUntrustedData } from "../../tool.js";
2✔
6

7
export class ListDatabasesTool extends MongoDBToolBase {
2✔
8
    public name = "list-databases";
80✔
9
    protected description = "List all databases for a MongoDB connection";
80✔
10
    protected argsShape = {};
80✔
11
    public operationType: OperationType = "metadata";
80✔
12

13
    protected async execute(): Promise<CallToolResult> {
2✔
14
        const provider = await this.ensureConnected();
12✔
15
        const dbs = (await provider.listDatabases("")).databases as { name: string; sizeOnDisk: bson.Long }[];
8✔
16

17
        return {
8✔
18
            content: formatUntrustedData(
8✔
19
                `Found ${dbs.length} databases`,
8✔
20
                dbs.length > 0
8✔
21
                    ? dbs.map((db) => `Name: ${db.name}, Size: ${db.sizeOnDisk.toString()} bytes`).join("\n")
8!
UNCOV
22
                    : undefined
×
23
            ),
12✔
24
        };
12✔
25
    }
12✔
26
}
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