Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

atlas-list-projects

Read-only

Retrieve a list of MongoDB Atlas projects to manage and organize your database resources. Filter by organization ID or view all projects for comprehensive oversight.

Instructions

List MongoDB Atlas projects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgIdNoAtlas organization ID to filter projects. If not provided, projects for all orgs are returned.

Implementation Reference

  • Implements the core logic of the 'atlas-list-projects' tool: fetches organizations, retrieves projects (filtered by orgId if provided), formats and returns the list of projects with details like name, id, orgId, orgName, and created date.
    protected async execute({ orgId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
        const orgData = await this.session.apiClient.listOrgs();
    
        if (!orgData?.results?.length) {
            return {
                content: [{ type: "text", text: "No organizations found in your MongoDB Atlas account." }],
            };
        }
    
        const orgs: Record<string, string> = orgData.results
            .filter((org) => org.id)
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
            .reduce((acc, org) => ({ ...acc, [org.id!]: org.name }), {});
    
        const data = orgId
            ? await this.session.apiClient.getOrgGroups({
                  params: {
                      path: {
                          orgId,
                      },
                  },
              })
            : await this.session.apiClient.listGroups();
    
        if (!data?.results?.length) {
            return {
                content: [{ type: "text", text: `No projects found in organization ${orgId}.` }],
            };
        }
    
        const serializedProjects = JSON.stringify(
            data.results.map((project) => ({
                name: project.name,
                id: project.id,
                orgId: project.orgId,
                orgName: orgs[project.orgId] ?? "N/A",
                created: project.created ? new Date(project.created).toLocaleString() : "N/A",
            })),
            null,
            2
        );
        return {
            content: formatUntrustedData(`Found ${data.results.length} projects`, serializedProjects),
        };
    }
  • Defines the input schema for the tool, with an optional 'orgId' parameter for filtering projects by organization.
    protected argsShape = {
        orgId: AtlasArgs.organizationId()
            .describe("Atlas organization ID to filter projects. If not provided, projects for all orgs are returned.")
            .optional(),
    };
  • Declares the ListProjectsTool class with the tool name 'atlas-list-projects', which is used during registration in the MCP server via generic tool registration in src/server.ts.
    export class ListProjectsTool extends AtlasToolBase {
        public name = "atlas-list-projects";
  • Re-exports ListProjectsTool for inclusion in the atlas tools module, which is then aggregated into AllTools for server registration.
    export { ListProjectsTool } from "./read/listProjects.js";
  • Aggregates all tools including AtlasTools (which includes ListProjectsTool) into AllTools array, used by the server for instantiating and registering all tools.
    export const AllTools: ToolClass[] = Object.values({
        ...MongoDbTools,
        ...AtlasTools,
        ...AtlasLocalTools,
    });
Behavior3/5

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

Annotations indicate readOnlyHint=true and destructiveHint=false, which the description doesn't contradict. The description adds minimal behavioral context beyond annotations—it specifies the resource but doesn't detail aspects like pagination, rate limits, authentication needs, or what the output includes. With annotations covering safety, it meets a baseline but lacks enriched behavioral disclosure.

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 appropriately sized for a simple list operation, with zero wasted content.

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's low complexity (one optional parameter, no output schema) and rich annotations, the description is minimally adequate. It covers the basic purpose but lacks details on output format, error handling, or integration with sibling tools. For a list tool with good annotations, it's complete enough to be functional but not comprehensive.

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 the orgId parameter fully documented in the schema. The description adds no additional parameter semantics beyond what the schema provides, such as examples or edge cases. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 projects'), providing specific functionality. However, it doesn't distinguish this tool from sibling tools like 'atlas-list-clusters' or 'atlas-list-alerts' beyond the resource type, missing explicit differentiation about what makes listing projects unique versus other list operations.

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

Usage Guidelines3/5

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

The description implies usage for listing projects but provides no explicit guidance on when to use this tool versus alternatives like 'atlas-list-orgs' or other list tools. The input schema hints at optional filtering by orgId, but the description itself lacks context on prerequisites, exclusions, or comparative use cases with siblings.

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