Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

atlas-list-alerts

Read-only

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,
        };
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the agent knows this is a safe read operation. The description adds no additional behavioral context beyond what annotations provide - no information about rate limits, authentication needs, pagination behavior, or what specific alert data is returned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words, front-loading the essential information with zero wasted words. It efficiently communicates the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with good annotations and full parameter documentation, the description is minimally adequate. However, without an output schema, the description should ideally provide some indication of what alert data is returned (e.g., alert types, statuses, timeframes) to help the agent understand the tool's utility.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already fully documents the single 'projectId' parameter. The description adds no additional parameter semantics beyond what's in the schema - no context about how projectId relates to alert listing or what happens if multiple projects need to be queried.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('MongoDB Atlas alerts'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'atlas-list-clusters' or 'atlas-list-projects' beyond specifying 'alerts' as the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, context for listing alerts, or comparison with other alert-related tools that might exist in the ecosystem.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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