Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions tests/accuracy/createDeployment.test.ts
Original file line number Diff line number Diff line change
@@ -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: {},
},
],
},
]);
102 changes: 102 additions & 0 deletions tests/accuracy/deleteDeployment.test.ts
Original file line number Diff line number Diff line change
@@ -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",
},
},
],
},
]);
31 changes: 31 additions & 0 deletions tests/accuracy/listDeployments.test.ts
Original file line number Diff line number Diff line change
@@ -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: {},
},
],
},
]);
Loading