Skip to content

Commit db06cc1

Browse files
fix accuracy tests
1 parent d535757 commit db06cc1

File tree

2 files changed

+18
-25
lines changed

2 files changed

+18
-25
lines changed

tests/accuracy/connectDeployment.test.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js";
22
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3+
import { formatUntrustedData } from "../../src/tools/tool.js";
34

45
describeAccuracyTests([
56
{
@@ -8,7 +9,7 @@ describeAccuracyTests([
89
{
910
toolName: "atlas-local-connect-deployment",
1011
parameters: {
11-
deploymentIdOrName: "my-database",
12+
deploymentName: "my-database",
1213
},
1314
},
1415
],
@@ -19,7 +20,7 @@ describeAccuracyTests([
1920
{
2021
toolName: "atlas-local-connect-deployment",
2122
parameters: {
22-
deploymentIdOrName: "my-instance",
23+
deploymentName: "my-instance",
2324
},
2425
},
2526
],
@@ -28,13 +29,10 @@ describeAccuracyTests([
2829
prompt: "If and only if, the local MongoDB deployment 'local-mflix' exists, then connect to it",
2930
mockedTools: {
3031
"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-
],
32+
content: formatUntrustedData(
33+
"Found 1 deployments",
34+
'[{"name":"local-mflix","state":"Running","mongodbVersion":"6.0"}]'
35+
),
3836
}),
3937
},
4038
expectedToolCalls: [
@@ -45,7 +43,7 @@ describeAccuracyTests([
4543
{
4644
toolName: "atlas-local-connect-deployment",
4745
parameters: {
48-
deploymentIdOrName: "local-mflix",
46+
deploymentName: "local-mflix",
4947
},
5048
},
5149
],
@@ -62,7 +60,7 @@ describeAccuracyTests([
6260
{
6361
toolName: "atlas-local-connect-deployment",
6462
parameters: {
65-
deploymentIdOrName: "local-mflix",
63+
deploymentName: "local-mflix",
6664
},
6765
},
6866
],

tests/accuracy/deleteDeployment.test.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js";
22
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3+
import { formatUntrustedData } from "../../src/tools/tool.js";
34

45
describeAccuracyTests([
56
{
@@ -28,13 +29,10 @@ describeAccuracyTests([
2829
prompt: "Delete all my local MongoDB instances",
2930
mockedTools: {
3031
"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\nlocal-comics | Running | 6.0",
36-
},
37-
],
32+
content: formatUntrustedData(
33+
"Found 2 deployments",
34+
'[{"name":"local-mflix","state":"Running","mongodbVersion":"6.0"},{"name":"local-comics","state":"Running","mongodbVersion":"6.0"}]'
35+
),
3836
}),
3937
},
4038
expectedToolCalls: [
@@ -60,13 +58,10 @@ describeAccuracyTests([
6058
prompt: "If and only if, the local MongoDB deployment 'local-mflix' exists, then delete it",
6159
mockedTools: {
6260
"atlas-local-list-deployments": (): CallToolResult => ({
63-
content: [
64-
{ type: "text", text: "Found 1 deployment:" },
65-
{
66-
type: "text",
67-
text: "Deployment Name | State | MongoDB Version\n----------------|----------------|----------------\nlocal-mflix | Running | 6.0",
68-
},
69-
],
61+
content: formatUntrustedData(
62+
"Found 1 deployments",
63+
'[{"name":"local-mflix","state":"Running","mongodbVersion":"6.0"}]'
64+
),
7065
}),
7166
},
7267
expectedToolCalls: [

0 commit comments

Comments
 (0)