atlas-list-orgs
Retrieve and display all MongoDB Atlas organizations you have access to for managing cloud database resources.
Instructions
List MongoDB Atlas organizations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/atlas/read/listOrgs.ts:12-33 (handler)The execute method implements the tool logic: calls the Atlas API to list organizations, handles empty results, maps to name/id, and formats output using formatUntrustedData.protected async execute(): Promise<CallToolResult> { const data = await this.session.apiClient.listOrgs(); if (!data?.results?.length) { return { content: [{ type: "text", text: "No organizations found in your MongoDB Atlas account." }], }; } const orgs = data.results.map((org) => ({ name: org.name, id: org.id, })); return { content: formatUntrustedData( `Found ${data.results.length} organizations in your MongoDB Atlas account.`, JSON.stringify(orgs) ), }; } }
- src/tools/atlas/read/listOrgs.ts:6-7 (registration)The tool class definition and name property registration for 'atlas-list-orgs'. Extends AtlasToolBase which likely handles MCP tool protocol.export class ListOrganizationsTool extends AtlasToolBase { public name = "atlas-list-orgs";
- Empty input schema indicating no arguments required for this tool.protected argsShape = {};
- src/tools/atlas/tools.ts:10-10 (registration)Barrel export re-exposing the tool for easy import in registration contexts.export { ListOrganizationsTool } from "./read/listOrgs.js";