File tree Expand file tree Collapse file tree 2 files changed +11
-21
lines changed
Expand file tree Collapse file tree 2 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,14 @@ You may experiment asking `Can you connect to my mongodb instance?`.
9898
9999#### MongoDB Atlas Tools
100100
101- - ` atlas-list-clusters ` - Lists MongoDB Atlas clusters
101+ - ` atlas-list-orgs ` - Lists MongoDB Atlas organizations
102102- ` atlas-list-projects ` - Lists MongoDB Atlas projects
103+ - ` atlas-create-project ` - Creates a new MongoDB Atlas project
104+ - ` atlas-list-clusters ` - Lists MongoDB Atlas clusters
103105- ` atlas-inspect-cluster ` - Inspect a specific MongoDB Atlas cluster
104106- ` atlas-create-free-cluster ` - Create a free MongoDB Atlas cluster
105- - ` atlas-create-access-list ` - Configure IP/CIDR access list for MongoDB Atlas clusters
106107- ` atlas-inspect-access-list ` - Inspect IP/CIDR ranges with access to MongoDB Atlas clusters
108+ - ` atlas-create-access-list ` - Configure IP/CIDR access list for MongoDB Atlas clusters
107109- ` atlas-list-db-users ` - List MongoDB Atlas database users
108110- ` atlas-create-db-user ` - List MongoDB Atlas database users
109111
Original file line number Diff line number Diff line change @@ -25,28 +25,12 @@ export class CreateProjectTool extends AtlasToolBase {
2525 try {
2626 const organizations = await this . session . apiClient . listOrganizations ( ) ;
2727 if ( ! organizations ?. results ?. length ) {
28- return {
29- content : [
30- {
31- type : "text" ,
32- text : "No organizations were found in your MongoDB Atlas account. Please create an organization first." ,
33- } ,
34- ] ,
35- isError : true ,
36- } ;
28+ throw new Error ( "No organizations were found in your MongoDB Atlas account. Please create an organization first." ) ;
3729 }
3830 organizationId = organizations . results [ 0 ] . id ;
3931 assumedOrg = true ;
4032 } catch {
41- return {
42- content : [
43- {
44- type : "text" ,
45- text : "Could not search for organizations in your MongoDB Atlas account, please provide an organization ID or create one first." ,
46- } ,
47- ] ,
48- isError : true ,
49- } ;
33+ throw new Error ( "Could not search for organizations in your MongoDB Atlas account, please provide an organization ID or create one first." ) ;
5034 }
5135 }
5236
@@ -55,10 +39,14 @@ export class CreateProjectTool extends AtlasToolBase {
5539 orgId : organizationId ,
5640 } as Group ;
5741
58- await this . session . apiClient . createProject ( {
42+ const group = await this . session . apiClient . createProject ( {
5943 body : input ,
6044 } ) ;
6145
46+ if ( ! group ?. id ) {
47+ throw new Error ( "Failed to create project" ) ;
48+ }
49+
6250 return {
6351 content : [
6452 {
You can’t perform that action at this time.
0 commit comments