Skip to main content
Glama

MongoDB MCP Server

Official
by mongodb-js
export.test.ts5.32 kB
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js"; import { Matcher } from "./sdk/matcher.js"; describeAccuracyTests([ { prompt: "Export all the movies in 'mflix.movies' namespace.", expectedToolCalls: [ { toolName: "export", parameters: { database: "mflix", collection: "movies", exportTitle: Matcher.string(), exportTarget: [ { name: "find", arguments: { filter: Matcher.emptyObjectOrUndefined, }, }, ], jsonExportFormat: Matcher.anyValue, }, }, ], }, { prompt: "Export all the movies in 'mflix.movies' namespace with runtime less than 100.", expectedToolCalls: [ { toolName: "export", parameters: { database: "mflix", collection: "movies", exportTitle: Matcher.string(), exportTarget: [ { name: "find", arguments: { filter: { runtime: { $lt: 100 }, }, }, }, ], jsonExportFormat: Matcher.anyValue, }, }, ], }, { prompt: "Export all the movie titles available in 'mflix.movies' namespace", expectedToolCalls: [ { toolName: "export", parameters: { database: "mflix", collection: "movies", exportTitle: Matcher.string(), exportTarget: [ { name: "find", arguments: { projection: { title: 1, _id: Matcher.anyOf( Matcher.undefined, Matcher.number((value) => value === 0) ), }, filter: Matcher.emptyObjectOrUndefined, }, }, ], jsonExportFormat: Matcher.anyValue, }, }, ], }, { prompt: "From the mflix.movies namespace, export the first 2 movies of Horror genre sorted ascending by their runtime", expectedToolCalls: [ { toolName: "export", parameters: { database: "mflix", collection: "movies", exportTitle: Matcher.string(), exportTarget: [ { name: "find", arguments: { filter: { genres: "Horror" }, sort: { runtime: 1 }, limit: 2, }, }, ], jsonExportFormat: Matcher.anyValue, }, }, ], }, { prompt: "Export an aggregation that groups all movie titles by the field release_year from mflix.movies", expectedToolCalls: [ { toolName: "export", parameters: { database: "mflix", collection: "movies", exportTitle: Matcher.string(), exportTarget: [ { name: "aggregate", arguments: { pipeline: [ { $group: Matcher.anyOf( Matcher.value({ _id: "$release_year", titles: { $push: "$title", }, }), Matcher.value({ _id: "$release_year", movies: { $push: "$title", }, }) ), }, ], }, }, ], jsonExportFormat: Matcher.anyValue, }, }, ], }, ]);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mongodb-js/mongodb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server