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

mongodb-js / mongodb-mcp-server / 14590701503

22 Apr 2025 08:50AM UTC coverage: 50.118% (-0.9%) from 50.98%
14590701503

Pull #82

github

blva
lint
Pull Request #82: add create project tool

23 of 150 branches covered (15.33%)

Branch coverage included in aggregate %.

8 of 31 new or added lines in 3 files covered. (25.81%)

4 existing lines in 1 file now uncovered.

401 of 696 relevant lines covered (57.61%)

36.62 hits per line

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

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

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

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

14
        const data = await this.session.apiClient.listProjects();
×
15

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

20
        // Format projects as a table
21
        const rows = data.results
×
22
            .map((project) => {
23
                const createdAt = project.created ? new Date(project.created).toLocaleString() : "N/A";
×
24
                return `${project.name} | ${project.id} | ${createdAt}`;
×
25
            })
26
            .join("\n");
27
        const formattedProjects = `Project Name | Project ID | Created At
×
28
----------------| ----------------| ----------------
29
${rows}`;
30
        return {
×
31
            content: [{ type: "text", text: formattedProjects }],
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