Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

atlas-list-alerts

Retrieve and display active alerts for a specific MongoDB Atlas project to monitor system health and performance issues.

Instructions

List MongoDB Atlas alerts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesAtlas project ID to list alerts for

Implementation Reference

  • The handler function that fetches alerts from the MongoDB Atlas API for the specified project, processes the data, and formats the response.
    protected async execute({ projectId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> { const data = await this.session.apiClient.listAlerts({ params: { path: { groupId: projectId, }, }, }); if (!data?.results?.length) { return { content: [{ type: "text", text: "No alerts found in your MongoDB Atlas project." }] }; } const alerts = data.results.map((alert) => ({ id: alert.id, status: alert.status, created: alert.created ? new Date(alert.created).toISOString() : "N/A", updated: alert.updated ? new Date(alert.updated).toISOString() : "N/A", eventTypeName: alert.eventTypeName, acknowledgementComment: alert.acknowledgementComment ?? "N/A", })); return { content: formatUntrustedData( `Found ${data.results.length} alerts in project ${projectId}`, JSON.stringify(alerts) ), }; }
  • Defines the input schema for the tool, specifying the required projectId argument.
    export const ListAlertsArgs = { projectId: AtlasArgs.projectId().describe("Atlas project ID to list alerts for"), };
  • Registers the tool by defining the class with name, description, operation type, and argument shape.
    export class ListAlertsTool extends AtlasToolBase { public name = "atlas-list-alerts"; protected description = "List MongoDB Atlas alerts"; static operationType: OperationType = "read"; protected argsShape = { ...ListAlertsArgs, };

Latest Blog Posts

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