Skip to main content
Glama

MongoDB MCP Server

Official
by mongodb-js
alerts.test.ts1.46 kB
import { expectDefined, getResponseContent } from "../../helpers.js"; import { describeWithAtlas, withProject } from "./atlasHelpers.js"; import { expect, it } from "vitest"; describeWithAtlas("atlas-list-alerts", (integration) => { it("should have correct metadata", async () => { const { tools } = await integration.mcpClient().listTools(); const listAlerts = tools.find((tool) => tool.name === "atlas-list-alerts"); expectDefined(listAlerts); expect(listAlerts.inputSchema.type).toBe("object"); expectDefined(listAlerts.inputSchema.properties); expect(listAlerts.inputSchema.properties).toHaveProperty("projectId"); }); withProject(integration, ({ getProjectId }) => { it("returns alerts in JSON format", async () => { const response = await integration.mcpClient().callTool({ name: "atlas-list-alerts", arguments: { projectId: getProjectId() }, }); const content = getResponseContent(response.content); // check that there are alerts or no alerts if (content.includes("Found alerts in project")) { expect(content).toContain("<untrusted-user-data-"); // expect projectId in the content expect(content).toContain(getProjectId()); } else { expect(content).toContain("No alerts found"); } }); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mongodb-js/mongodb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server