mongodb-query-optimizer

mongodb query optimizer

mongodb ↓ 3.3k
Claude Code
View source ↗

What it does

  • Query/index optimization or performance help
  • Why a query is slow or how to speed it up
  • Slow queries on their cluster and/or how to optimize them
  • Use MongoDB MCP server atlas-get-performance-advisor tool to fetch slow query logs and performance advisor output
  • Make suggestions based on this information
  • Use atlas-get-performance-advisor MCP tool to fetch slow query logs and performance advisor output
  • collection-indexes — Use the result's classicIndexes (each has name, key) to see if the query can already use an existing index.

Requirements & configuration

  • If you need a project ID, call atlas-list-projects first. Then call atlas-get-performance-advisor with only the operations you need:
  • Try to get the cluster name from the connection string and deduce the project name you need in atlas-list-projects; if you are not sure, then ask the user for cluster name and project id.

Derived from the skill's own SKILL.md documentation · extracted 2026-07-23

mongodb query optimizer

Source

Repository: https://github.com/mongodb/agent-skills

mongodb-query-optimizer FAQ

What does the mongodb-query-optimizer skill do?

>- Help with MongoDB query optimization and indexing. Use only when the user asks for optimization or performance: "How do I optimize this query?", "How do I index this?", "Why is this query slow?", "Can you fix my slow queries?", "What are the slow queries on my cluster?", etc. Do not invoke for general MongoDB query writing unless user asks for performance or index help. Prefer indexing as optimization strategy. Use MongoDB MCP when available. Query/index optimization or performance help Why a query is slow or how to speed it up

What does mongodb-query-optimizer require?

If you need a project ID, call atlas-list-projects first. Then call atlas-get-performance-advisor with only the operations you need: Try to get the cluster name from the connection string and deduce the project name you need in atlas-list-projects; if you are not sure, then ask the user for cluster name and project id.

How do I install mongodb-query-optimizer?

Run: npx -y skills add https://github.com/mongodb/agent-skills --skill mongodb-query-optimizer --agent claude-code — the source lives at github.com/mongodb/agent-skills.

Maintain mongodb-query-optimizer?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[mongodb-query-optimizer on getagentictools](https://getagentictools.com/skills/mongodb-agent-skills-mongodb-query-optimizer?ref=badge)
npx agentictools info skills/mongodb-agent-skills-mongodb-query-optimizer

The second line is the CLI lookup for this page — handy in READMEs and docs.