MongoDB MCP Server
by jonfreeland
explain_query
Get the execution plan for a query.
Helps understand:
- How MongoDB will execute the query
- Which indexes will be used
- Number of documents examined
- Execution stages and timing
Use this to optimize slow queries.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection | Yes | Collection name | |
database | No | Database name (optional if default database is configured) | |
filter | Yes | MongoDB query filter to explain | |
projection | No | MongoDB projection (optional) | |
sort | No | MongoDB sort specification (optional) |