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

mongodb-js / mongodb-mcp-server / 14614840974

23 Apr 2025 09:33AM UTC coverage: 76.675% (+23.5%) from 53.208%
14614840974

Pull #83

github

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

81 of 152 branches covered (53.29%)

Branch coverage included in aggregate %.

28 of 39 new or added lines in 6 files covered. (71.79%)

4 existing lines in 3 files now uncovered.

560 of 684 relevant lines covered (81.87%)

27.03 hits per line

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

60.0
/src/tools/mongodb/read/collectionIndexes.ts
1
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
import { DbOperationArgs, MongoDBToolBase } from "../mongodbTool.js";
16✔
3
import { ToolArgs, OperationType } from "../../tool.js";
4

5
export class CollectionIndexesTool extends MongoDBToolBase {
16✔
6
    protected name = "collection-indexes";
16✔
7
    protected description = "Describe the indexes for a collection";
16✔
8
    protected argsShape = DbOperationArgs;
16✔
9
    protected operationType: OperationType = "read";
16✔
10

11
    protected async execute({ database, collection }: ToolArgs<typeof DbOperationArgs>): Promise<CallToolResult> {
12
        const provider = await this.ensureConnected();
×
13
        const indexes = await provider.getIndexes(database, collection);
×
14

15
        return {
×
16
            content: indexes.map((indexDefinition) => {
17
                return {
×
18
                    text: `Field: ${indexDefinition.name}: ${JSON.stringify(indexDefinition.key)}`,
19
                    type: "text",
20
                };
21
            }),
22
        };
23
    }
24
}
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