Skip to main content
Glama
mongodb-developer

MongoDB Atlas MCP Server

Official

list_atlas_clusters

Retrieve all MongoDB Atlas clusters within a specified project to view and manage your database deployments.

Instructions

Lists all clusters in an Atlas project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe ID of the Atlas project.

Implementation Reference

  • The handler function that executes the list_atlas_clusters tool. It makes an API request to fetch clusters for the given projectId, enhances connection strings, and returns the formatted result.
    private async listAtlasClusters(input: ListClustersInput) {
      try {
        const url = `https://cloud.mongodb.com/api/atlas/v1.0/groups/${input.projectId}/clusters`;
        const result = await this.makeAtlasRequest(url, 'GET');
        
        // Add appName to connection strings in all clusters
        this.addAppNameToConnectionStrings(result);
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{
            type: 'text',
            text: error.message
          }],
          isError: true
        };
      }
    }
  • TypeScript interface defining the input schema for listAtlasClusters: requires projectId.
    interface ListClustersInput {
      projectId: string;
    }
  • src/index.ts:487-499 (registration)
    Tool registration in the ListTools response, including name, description, and inputSchema.
      name: 'list_atlas_clusters',
      description: 'Lists all clusters in an Atlas project.',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'string',
            description: 'The ID of the Atlas project.',
          },
        },
        required: ['projectId'],
      },
    }
  • src/index.ts:564-566 (registration)
    Dispatch in CallToolRequest handler that routes to the listAtlasClusters method.
    case 'list_atlas_clusters':
      result = await this.listAtlasClusters(input as unknown as ListClustersInput);
      break;
  • Input validation for list_atlas_clusters parameters before execution.
    case 'list_atlas_clusters':
      if (!input.projectId) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid list clusters arguments');
      }
      break;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but lacks critical details such as whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior, or error handling. This leaves significant gaps for an agent to understand how to invoke it safely.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It does not address behavioral aspects like safety, performance, or output format, which are crucial for a list operation. While concise, it fails to provide enough context for reliable agent use without additional assumptions.

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?

The input schema has 100% description coverage, with 'projectId' clearly documented. The description implies the parameter by mentioning 'in an Atlas project' but adds no additional semantic context beyond what the schema provides, such as format examples or sourcing instructions. This meets the baseline for high schema coverage.

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 ('Lists') and resource ('all clusters in an Atlas project'), making the purpose immediately understandable. However, it does not explicitly differentiate from sibling tools like 'list_atlas_projects' or 'get_atlas_connection_strings', which would require mentioning specific scope or output differences.

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. It does not mention prerequisites (e.g., needing a project ID), exclusions, or comparisons to siblings like 'list_atlas_projects' for broader listings or 'get_atlas_connection_strings' for cluster-specific details.

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-developer/mcp-mongodb-atlas'

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