You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.sort((a,b)=>a.category.localeCompare(b.category));// Sort Atlas tools before MongoDB tools
19
19
20
20
// Find what Atlas connect tools are available and suggest when the LLM should to use each. If no Atlas tools are found, return a suggestion for the MongoDB connect tool.
connectionString: z.string().describe("MongoDB connection string (in the mongodb:// or mongodb+srv:// format)"),
12
-
})
13
-
.describe("Options for connecting to MongoDB.");
14
-
15
-
constconnectedSchema=z
16
-
.object({
17
-
connectionString: z
18
-
.string()
19
-
.optional()
20
-
.describe("MongoDB connection string to switch to (in the mongodb:// or mongodb+srv:// format)"),
21
-
})
22
-
.describe(
23
-
"Options for switching the current MongoDB connection. If a connection string is not provided, the connection string from the config will be used."
24
-
);
25
-
26
-
constconnectedName="switch-connection"asconst;
27
-
constdisconnectedName="connect"asconst;
28
-
29
-
constconnectedDescription=
30
-
"Switch to a different MongoDB connection. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new instance.";
31
-
constdisconnectedDescription=
32
-
"Connect to a MongoDB instance. The config resource captures if the server is already connected to a MongoDB cluster. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new MongoDB cluster.";
"Connect to a MongoDB instance. The config resource captures if the server is already connected to a MongoDB cluster. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new MongoDB cluster.";
37
10
38
11
// Here the default is empty just to trigger registration, but we're going to override it with the correct
39
12
// schema in the register method.
40
-
protectedargsShape={
41
-
connectionString: z.string().optional(),
13
+
protectedoverrideargsShape={
14
+
connectionString: z.string().describe("MongoDB connection string (in the mongodb:// or mongodb+srv:// format)"),
"Switch to a different MongoDB connection. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new instance.";
12
+
13
+
protectedoverrideargsShape={
14
+
connectionString: z
15
+
.string()
16
+
.optional()
17
+
.describe(
18
+
"MongoDB connection string to switch to (in the mongodb:// or mongodb+srv:// format). If a connection string is not provided, the connection string from the config will be used."
Copy file name to clipboardExpand all lines: tests/integration/tools/mongodb/connect/connect.test.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,8 @@ describeWithMongoDB(
26
26
[
27
27
{
28
28
name: "connectionString",
29
-
description: "MongoDB connection string to switch to (in the mongodb:// or mongodb+srv:// format)",
29
+
description:
30
+
"MongoDB connection string to switch to (in the mongodb:// or mongodb+srv:// format). If a connection string is not provided, the connection string from the config will be used.",
0 commit comments