Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

atlas-inspect-cluster

Read-only

Analyze MongoDB Atlas cluster configuration and status by providing project ID and cluster name to monitor performance and identify issues.

Instructions

Inspect MongoDB Atlas cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesAtlas project ID
clusterNameYesAtlas cluster name

Implementation Reference

  • Registration of all tools including AtlasTools (which re-exports InspectClusterTool) into the AllTools array for MCP tool provision.
    import * as AtlasTools from "./atlas/tools.js";
    import * as AtlasLocalTools from "./atlasLocal/tools.js";
    import * as MongoDbTools from "./mongodb/tools.js";
    import type { ToolClass } from "./tool.js";
    
    // Export the collection of tools for easier reference
    export const AllTools: ToolClass[] = Object.values({
        ...MongoDbTools,
        ...AtlasTools,
        ...AtlasLocalTools,
    });
  • The tool's execute handler fetches cluster details via helper and formats output.
    protected async execute({ projectId, clusterName }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
        const cluster = await inspectCluster(this.session.apiClient, projectId, clusterName);
    
        return this.formatOutput(cluster);
    }
    
    private formatOutput(formattedCluster: Cluster): CallToolResult {
        const clusterDetails = {
            name: formattedCluster.name || "Unknown",
            instanceType: formattedCluster.instanceType,
            instanceSize: formattedCluster.instanceSize || "N/A",
            state: formattedCluster.state || "UNKNOWN",
            mongoDBVersion: formattedCluster.mongoDBVersion || "N/A",
            connectionStrings: formattedCluster.connectionStrings || {},
        };
    
        return {
            content: formatUntrustedData("Cluster details:", JSON.stringify(clusterDetails)),
        };
    }
  • Input schema definition for projectId and clusterName using AtlasArgs.
    export const InspectClusterArgs = {
        projectId: AtlasArgs.projectId().describe("Atlas project ID"),
        clusterName: AtlasArgs.clusterName().describe("Atlas cluster name"),
    };
    
    export class InspectClusterTool extends AtlasToolBase {
        public name = "atlas-inspect-cluster";
        protected description = "Inspect MongoDB Atlas cluster";
        static operationType: OperationType = "read";
        protected argsShape = {
            ...InspectClusterArgs,
        };
  • Re-export of InspectClusterTool for inclusion in AtlasTools.
    export { InspectClusterTool } from "./read/inspectCluster.js";
  • Core helper function that calls Atlas API to inspect cluster (both dedicated and flex) and formats the response.
    export async function inspectCluster(apiClient: ApiClient, projectId: string, clusterName: string): Promise<Cluster> {
        try {
            const cluster = await apiClient.getCluster({
                params: {
                    path: {
                        groupId: projectId,
                        clusterName,
                    },
                },
            });
            return formatCluster(cluster);
        } catch (error) {
            try {
                const cluster = await apiClient.getFlexCluster({
                    params: {
                        path: {
                            groupId: projectId,
                            name: clusterName,
                        },
                    },
                });
                return formatFlexCluster(cluster);
            } catch (flexError) {
                const err = flexError instanceof Error ? flexError : new Error(String(flexError));
                apiClient.logger.error({
                    id: LogId.atlasInspectFailure,
                    context: "inspect-cluster",
                    message: `error inspecting cluster: ${err.message}`,
                });
                throw error;
            }
        }
    }
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 behavioral context beyond this, such as what 'inspect' entails (e.g., returns configuration details, status, or metrics) or any constraints like rate limits or authentication needs. With annotations covering safety, a 3 is appropriate as the description doesn't contradict them but adds minimal value.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. It earns its place by clearly stating the tool's function, making it highly concise and well-structured for quick understanding.

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?

Given the tool has 2 parameters with full schema coverage and annotations indicating a safe read operation, the description is minimally adequate. However, with no output schema and siblings that might overlap (e.g., 'atlas-list-clusters'), it lacks context on what 'inspect' returns or how it differs, leaving gaps in completeness for effective tool selection.

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?

Schema description coverage is 100%, with clear descriptions for both parameters (projectId and clusterName). The description adds no additional meaning beyond what the schema provides, such as explaining how to obtain these IDs or their significance. Baseline 3 is correct when the schema fully documents parameters.

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 action ('Inspect') and resource ('MongoDB Atlas cluster'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'atlas-list-clusters' or 'atlas-get-performance-advisor', which would require more specific language about what 'inspect' entails versus 'list' or 'get' operations.

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. With siblings like 'atlas-list-clusters' (which likely lists multiple clusters) and 'atlas-get-performance-advisor' (which might provide performance insights), there's no indication that this tool is for detailed inspection of a specific cluster, leaving the agent to guess based on the name alone.

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