Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

export

Read-only

Save MongoDB query or aggregation results as EJSON, choosing relaxed or canonical format.

Instructions

Export a query or aggregation results in the specified EJSON format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesDatabase name
collectionYesCollection name
exportTitleYesA short description to uniquely identify the export.
connectionIdYesThe connection to run the operation against. Use the id returned by one of the connect tools, or "preconfigured" to use the connection string the server was configured with.
exportTargetYesThe export target along with its arguments.
jsonExportFormatNoThe format to be used when exporting collection data as EJSON with default being relaxed. relaxed: A string format that emphasizes readability and interoperability at the expense of type preservation. That is, conversion from relaxed format to BSON can lose type information. canonical: A string format that emphasizes type preservation at the expense of readability and interoperability. That is, conversion from canonical to BSON will generally preserve type information except in certain specific cases.relaxed
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds the EJSON format context, but it does not disclose what happens during export (e.g., whether results are returned as files, streamed, or stored) or any other behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with zero filler. It states the core function immediately and does not waste words, making it highly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a complex exportTarget parameter and no output schema, yet the description is only one sentence. It does not explain the export flow or return value (e.g., whether the tool returns a file, job ID, or stream URI), which is a significant gap given the tool's complexity and the absence of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with detailed descriptions for all six parameters including the complex exportTarget structure. The description only mentions 'EJSON format', which is already captured by the jsonExportFormat parameter, so it adds no additional parameter-level meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Export' and names the resource ('query or aggregation results') and the target format ('EJSON'), clearly distinguishing this tool from read-only siblings like find and aggregate. It immediately tells the agent what function the tool performs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The sentence implies the tool is for exporting query/aggregation results, but it gives no explicit guidance on when to prefer this over alternatives such as find/aggregate, nor any prerequisites or exclusions. The use case is inferable but not elaborated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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