Skip to content

Commit 0c53f48

Browse files
committed
adds accuracy tests
1 parent 0d0581d commit 0c53f48

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js";
2+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3+
4+
describeAccuracyTests([
5+
{
6+
prompt: "Connect to the local MongoDB cluster called 'my-database'",
7+
expectedToolCalls: [
8+
{
9+
toolName: "atlas-local-connect-deployment",
10+
parameters: {
11+
deploymentIdOrName: "my-database",
12+
},
13+
},
14+
],
15+
},
16+
{
17+
prompt: "Connect to the local MongoDB atlas database called 'my-instance'",
18+
expectedToolCalls: [
19+
{
20+
toolName: "atlas-local-connect-deployment",
21+
parameters: {
22+
deploymentIdOrName: "my-instance",
23+
},
24+
},
25+
],
26+
},
27+
{
28+
prompt: "If and only if, the local MongoDB deployment 'local-mflix' exists, then connect to it",
29+
mockedTools: {
30+
"atlas-local-list-deployments": (): CallToolResult => ({
31+
content: [
32+
{ type: "text", text: "Found 1 deployment:" },
33+
{
34+
type: "text",
35+
text: "Deployment Name | State | MongoDB Version\n----------------|----------------|----------------\nlocal-mflix | Running | 6.0",
36+
},
37+
],
38+
}),
39+
},
40+
expectedToolCalls: [
41+
{
42+
toolName: "atlas-local-list-deployments",
43+
parameters: {},
44+
},
45+
{
46+
toolName: "atlas-local-connect-deployment",
47+
parameters: {
48+
deploymentIdOrName: "local-mflix",
49+
},
50+
},
51+
],
52+
},
53+
{
54+
prompt: "Connect to a new local MongoDB cluster named 'local-mflix'",
55+
expectedToolCalls: [
56+
{
57+
toolName: "atlas-local-create-deployment",
58+
parameters: {
59+
deploymentName: "local-mflix",
60+
},
61+
},
62+
{
63+
toolName: "atlas-local-connect-deployment",
64+
parameters: {
65+
deploymentIdOrName: "local-mflix",
66+
},
67+
},
68+
],
69+
},
70+
]);

0 commit comments

Comments
 (0)