Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

explain

Read-only

Retrieve execution statistics for a MongoDB query's winning plan by specifying database, collection, and method (find, aggregate, or count) with optional verbosity levels.

Instructions

Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesDatabase name
collectionYesCollection name
methodYesThe method and its arguments to run
verbosityNoThe verbosity of the explain plan, defaults to queryPlanner. If the user wants to know how fast is a query in execution time, use executionStats. It supports all verbosities as defined in the MongoDB Driver.queryPlanner

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
explainResultYes
methodYes
verbosityYes
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 agent knows it's a safe read operation. The description adds that it returns statistics about the winning plan, but does not elaborate on behavioral differences between verbosity levels (e.g., executionStats actually runs the query) or other side effects.

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?

The description is a single sentence of 20 words that immediately conveys the tool's purpose. There is no fluff or redundant information, making it highly concise and effectively front-loaded.

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

Completeness3/5

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

Given that there is an output schema (not shown but indicated in context) and annotations, the description is minimally sufficient. It does not elaborate on use cases, constraints, or prerequisites beyond what is in structured fields, but it covers the core function. For a tool with many sibling tools, more context might help, but it is not deficient.

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 coverage is 100%, so the schema already documents all parameters and their meanings. The description does not add any extra semantic information beyond the schema's definitions, thus meeting the baseline expectation without enhancement.

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

Purpose4/5

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

The description clearly states that the tool returns statistics about the execution of the winning query plan, which is a specific and distinguishable purpose. It is not a tautology and differentiates from sibling tools that perform queries (find, aggregate, count) rather than analyze them.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention scenarios like performance analysis, when to prefer queryPlanner vs executionStats, or conditions under which the agent should not use this tool.

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