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

mongodb-js / mongodb-mcp-server / 14637601756

24 Apr 2025 08:57AM UTC coverage: 42.737% (-32.7%) from 75.474%
14637601756

Pull #103

github

fmenezes
fix: rename describes
Pull Request #103: refactor: split test helpers

30 of 187 branches covered (16.04%)

Branch coverage included in aggregate %.

376 of 763 relevant lines covered (49.28%)

1.85 hits per line

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

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

6
export class ListDatabasesTool extends MongoDBToolBase {
1✔
7
    protected name = "list-databases";
2✔
8
    protected description = "List all databases for a MongoDB connection";
2✔
9
    protected argsShape = {};
2✔
10

11
    protected operationType: OperationType = "metadata";
2✔
12

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

17
        return {
×
18
            content: dbs.map((db) => {
19
                return {
×
20
                    text: `Name: ${db.name}, Size: ${db.sizeOnDisk.toString()} bytes`,
21
                    type: "text",
22
                };
23
            }),
24
        };
25
    }
26
}
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

© 2026 Coveralls, Inc