diff --git a/tests/accuracy/createDeployment.test.ts b/tests/accuracy/createDeployment.test.ts new file mode 100644 index 000000000..559206a46 --- /dev/null +++ b/tests/accuracy/createDeployment.test.ts @@ -0,0 +1,82 @@ +import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js"; +import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; + +describeAccuracyTests([ + { + prompt: "Setup a local MongoDB cluster named 'local-cluster'", + expectedToolCalls: [ + { + toolName: "atlas-local-create-deployment", + parameters: { + deploymentName: "local-cluster", + }, + }, + ], + }, + { + prompt: "Create a local MongoDB instance named 'local-cluster'", + expectedToolCalls: [ + { + toolName: "atlas-local-create-deployment", + parameters: { + deploymentName: "local-cluster", + }, + }, + ], + }, + { + prompt: "Setup a local MongoDB database named 'local-cluster'", + expectedToolCalls: [ + { + toolName: "atlas-local-create-deployment", + parameters: { + deploymentName: "local-cluster", + }, + }, + ], + }, + { + prompt: "Setup a local MongoDB cluster, do not specify a name", + expectedToolCalls: [ + { + toolName: "atlas-local-create-deployment", + parameters: {}, + }, + ], + }, + { + prompt: "If and only if, the local MongoDB deployment 'new-database' does not exist, then create it", + expectedToolCalls: [ + { + toolName: "atlas-local-list-deployments", + parameters: {}, + }, + { + toolName: "atlas-local-create-deployment", + parameters: { + deploymentName: "new-database", + }, + }, + ], + }, + { + prompt: "If and only if, the local MongoDB deployment 'existing-database' does not exist, then create it", + mockedTools: { + "atlas-local-list-deployments": (): CallToolResult => ({ + content: [ + { type: "text", text: "Found 1 deployment:" }, + { + type: "text", + text: "Deployment Name | State | MongoDB Version\n----------------|----------------|----------------\nexisting-database | Running | 6.0", + }, + ], + }), + }, + expectedToolCalls: [ + { + toolName: "atlas-local-list-deployments", + parameters: {}, + }, + ], + }, +]); diff --git a/tests/accuracy/deleteDeployment.test.ts b/tests/accuracy/deleteDeployment.test.ts new file mode 100644 index 000000000..dcd4d8249 --- /dev/null +++ b/tests/accuracy/deleteDeployment.test.ts @@ -0,0 +1,102 @@ +import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js"; +import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; + +describeAccuracyTests([ + { + prompt: "Delete the local MongoDB cluster called 'my-database'", + expectedToolCalls: [ + { + toolName: "atlas-local-delete-deployment", + parameters: { + deploymentName: "my-database", + }, + }, + ], + }, + { + prompt: "Delete the local MongoDB atlas database called 'my-instance'", + expectedToolCalls: [ + { + toolName: "atlas-local-delete-deployment", + parameters: { + deploymentName: "my-instance", + }, + }, + ], + }, + { + prompt: "Delete all my local MongoDB instances", + mockedTools: { + "atlas-local-list-deployments": (): CallToolResult => ({ + content: [ + { type: "text", text: "Found 1 deployment:" }, + { + type: "text", + text: "Deployment Name | State | MongoDB Version\n----------------|----------------|----------------\nlocal-mflix | Running | 6.0\nlocal-comics | Running | 6.0", + }, + ], + }), + }, + expectedToolCalls: [ + { + toolName: "atlas-local-list-deployments", + parameters: {}, + }, + { + toolName: "atlas-local-delete-deployment", + parameters: { + deploymentName: "local-mflix", + }, + }, + { + toolName: "atlas-local-delete-deployment", + parameters: { + deploymentName: "local-comics", + }, + }, + ], + }, + { + prompt: "If and only if, the local MongoDB deployment 'local-mflix' exists, then delete it", + mockedTools: { + "atlas-local-list-deployments": (): CallToolResult => ({ + content: [ + { type: "text", text: "Found 1 deployment:" }, + { + type: "text", + text: "Deployment Name | State | MongoDB Version\n----------------|----------------|----------------\nlocal-mflix | Running | 6.0", + }, + ], + }), + }, + expectedToolCalls: [ + { + toolName: "atlas-local-list-deployments", + parameters: {}, + }, + { + toolName: "atlas-local-delete-deployment", + parameters: { + deploymentName: "local-mflix", + }, + }, + ], + }, + { + prompt: "Create a local MongoDB cluster named 'local-mflix' then delete it immediately", + expectedToolCalls: [ + { + toolName: "atlas-local-create-deployment", + parameters: { + deploymentName: "local-mflix", + }, + }, + { + toolName: "atlas-local-delete-deployment", + parameters: { + deploymentName: "local-mflix", + }, + }, + ], + }, +]); diff --git a/tests/accuracy/listDeployments.test.ts b/tests/accuracy/listDeployments.test.ts new file mode 100644 index 000000000..762ef4f95 --- /dev/null +++ b/tests/accuracy/listDeployments.test.ts @@ -0,0 +1,31 @@ +import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js"; + +describeAccuracyTests([ + { + prompt: "What MongoDB clusters do I have running?", + expectedToolCalls: [ + { + toolName: "atlas-local-list-deployments", + parameters: {}, + }, + ], + }, + { + prompt: "What MongoDB instances do I have running?", + expectedToolCalls: [ + { + toolName: "atlas-local-list-deployments", + parameters: {}, + }, + ], + }, + { + prompt: "How many MongoDB clusters are running?", + expectedToolCalls: [ + { + toolName: "atlas-local-list-deployments", + parameters: {}, + }, + ], + }, +]);