[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-mongodb-mongodb-query-optimizer":3,"mdc--fzjnos-key":40,"related-repo-mongodb-mongodb-query-optimizer":1509,"related-org-mongodb-mongodb-query-optimizer":1599},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":35,"sourceUrl":38,"mdContent":39},"mongodb-query-optimizer","optimize MongoDB queries and indexes","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.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"mongodb","MongoDB","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fmongodb.jpg",[12,16,17,20],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Database","database",{"name":21,"slug":22,"type":15},"Debugging","debugging",155,"https:\u002F\u002Fgithub.com\u002Fmongodb\u002Fagent-skills","2026-07-13T06:15:44.51826","Apache-2.0",28,[29,30,31,32,33,34],"agent","claude","cursor","gemini-cli-extension","mcp","skills",{"repoUrl":24,"stars":23,"forks":27,"topics":36,"description":37},[29,30,31,32,33,34],"Use the official MongoDB Skills with your favorite coding agent to build faster.","https:\u002F\u002Fgithub.com\u002Fmongodb\u002Fagent-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fmongodb-query-optimizer","---\nname: mongodb-query-optimizer\ndescription: >-\n  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.\ncompatibility: >-\n  Best with MongoDB MCP server. Uses collection-indexes and explain when the connection string works; uses Atlas Performance Advisor when Atlas API is configured. Without either, suggest indexes from query shape only. User creates indexes in Atlas or migrations unless tooling allows otherwise.\nlicense: Apache-2.0\nmetadata:\n  version: \"1.0.0\"\n---\n\n# MongoDB Query Optimizer\n\n## When this skill is invoked\n\nInvoke **only** when the user wants:\n\n- Query\u002Findex **optimization** or **performance** help  \n- **Why** a query is slow or **how to speed it up**  \n- **Slow queries** on their cluster and\u002For **how to optimize them**\n\nDo **not** invoke for routine query authoring unless the user has requested help with optimization, slow queries, or indexing.\n\n## High Level Workflow\n\n### General Performance Help\n\nIf the user wants to examine slow queries, or is looking for general performance suggestions (not regarding any particular query):\n\n- Use MongoDB MCP server **atlas-get-performance-advisor** tool to fetch slow query logs and performance advisor output  \n- Make suggestions based on this information\n\nIf Atlas MCP Server for Atlas is not configured or you don’t have enough information to run **atlas-get-performance-advisor** against the correct cluster, tell the user that general performance analysis requires Atlas MCP Server configuration with API credentials, and suggest they configure it or ask about a specific query instead.\n\n### Help with a Specific Query\n\nIf the user is asking about a particular query:\n\n- Use **collection-indexes**, **explain**, and **find** MCP tools to get existing indexes on the collection, explain() output for the query, and a sample document from the collection  \n- Use **atlas-get-performance-advisor MCP** tool to fetch slow query logs and performance advisor output\n\nThen make an optimization suggestion based on collected information and MongoDB best practices and examples from reference files. Prefer creating an index that fully covers the query if possible. If you cannot use MongoDB MCP Server then still try to make a suggestion.\n\n## MCP: available tools\n\n**How to invoke.** Call the **MongoDB MCP server** with the **exact tool name** as `toolName` and a single **arguments object** as `arguments`. Do not pass the tool name as an option, query param, or nested key; pass it as the MCP tool name and the parameters as the arguments object. Full MCP Server tool reference: [MongoDB MCP Server Tools](https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fmcp-server\u002Ftools\u002F).\n\n**Database tools** (when the MCP cluster connection works):\n\n| Tool name (exact) | Arguments object |\n| :---- | :---- |\n| `collection-indexes` | `{ \"database\": \"\u003Cdb>\", \"collection\": \"\u003Ccoll>\" }` — both required strings. |\n| `explain` | `{ \"database\": \"\u003Cdb>\", \"collection\": \"\u003Ccoll>\", \"method\": [ { \"name\": \"find\", \"arguments\": { \"filter\": {...}, \"sort\": {...}, \"limit\": N } } ], \"verbosity\": \"executionStats\" }`. `method` is an array of one object: `name` is `\"find\"`, `\"aggregate\"`, or `\"count\"`; `arguments` holds that method's params (e.g. find: `filter`, `sort`, `limit`; aggregate: `pipeline`; count: `query`). Optional `verbosity`: `\"queryPlanner\"` (default), `\"executionStats\"`, `\"queryPlannerExtended\"`, `\"allPlansExecution\"`. |\n| `find` |  `{ \"database\": \"\u003Cdb>\", \"collection\": \"\u003Ccoll>\", \"filter\": {...}, \"projection\": {...}, \"sort\": {...}, \"limit\": N }` — `database`, `collection`, and `filter` are required. Optional: `projection`, `sort`, `limit`. |\n\n**Atlas tools** (when Atlas API credentials are configured):\n\n| Tool name (exact) | Arguments object |\n| :---- | :---- |\n| `atlas-list-projects` | `{}` or `{ \"orgId\": \"\u003C24-char hex>\" }`. Returns projects with their IDs; use to get `projectId` for Performance Advisor. |\n| `atlas-get-performance-advisor` | **Required:** `\"projectId\"` (24-character hex string), `\"clusterName\"` (string, 1–64 chars, alphanumeric\u002Funderscore\u002Fdash). **Optional:** `\"operations\"` — array of strings from `\"suggestedIndexes\"`, `\"dropIndexSuggestions\"`, `\"slowQueryLogs\"`, `\"schemaSuggestions\"` (request only what you need); for slowQueryLogs only: `\"since\"` (ISO 8601 date-time), `\"namespaces\"` (array of `\"db.coll\"` strings). |\n\nFor a user question, try to fetch information from both the connection string and Atlas API related to the query you are optimizing.\n\n### 1\\. DB connection string works for MongoDB MCP\n\nTypical flow: call `collection-indexes` → `explain` → `find` (sample doc).\n\n- **`collection-indexes`** — Use the result's `classicIndexes` (each has `name`, `key`) to see if the query can already use an existing index.\n- **`explain`** — Run in `\"queryPlanner\"` mode first to check for COLLSCAN. If the query uses an index or the collection is very small, run again with `\"executionStats\"` (10-second timeout) to get docs scanned vs. returned.\n\n### 2\\. Atlas API access works for MongoDB MCP\n\nIf you need a project ID, call `atlas-list-projects` first. Then call `atlas-get-performance-advisor` with only the `operations` you need:\n\n| Operation value | Use when |\n| :---- | :---- |\n| `slowQueryLogs` | Fetching slow queries—**prioritize by slowest and most frequent**. Optional: `namespaces` to scope to a collection; `since` for a time window. |\n| `suggestedIndexes` | Fetching cluster index recommendations |\n| `dropIndexSuggestions` | User asks what to remove or reduce index overhead |\n| `schemaSuggestions` | User asks for schema\u002Fquery-structure advice alongside indexes |\n\nDo not pass the MCP tool name as an `operations` value—`operations` is a separate argument listing what data to fetch.\n\n## Example workflow 1 (help with specific query)\n\n**User:** \"Why is this query slow? `db.orders.find({status: 'shipped', region: 'US'}).sort({date: -1})`\"\n\n**If MCP db connection is configured and the database + collection names are known**, run steps 1–3. Otherwise skip to step 4.\n\n1. **Check existing collection indexes:**\n   - Call `collection-indexes` with database=`store`, collection=`orders`\n   - Result shows: `{_id: 1}`, `{status: 1}`, `{date: -1}`\n\n2. **Run explain:**\n   - Call `explain` with method=`find`, filter=`{status: 'shipped', region: 'US'}`, sort=`{date: -1}`, verbosity=`queryPlanner` and `executionStats`\n   - Result: Uses `{status: 1}` index, then in-memory SORT, `totalKeysExamined: 50000`, `nReturned: 100`\n\n3. **Run find:**\n   - Call `find` with limit=1 to fetch a sample document to impute the schema.\n\n**If MCP Atlas connection is configured**, run step 4. Otherwise skip to step 5.\n\n4. **Run atlas-get-performance-advisor:**\n   - Try to get the cluster name from the MCP connection string, or ask the user for projectId\u002FclusterName\n   - Use slowQueryLogs to fetch slow query logs from database=`store`, collection=`orders` in the past 24 hours\n   - Use suggestedIndexes to check for index suggestions for the query\n\n5. **Diagnose:** Based on explain output and slow query logs, this query targets 100 docs but scans 50K index entries (poor selectivity: 0.002). In-memory sort adds overhead. Index doesn't support both filter fields or sort.\n\n6. **Recommend:** Create compound index `{status: 1, region: 1, date: -1}` following ESR (two equality fields, then sort). This eliminates in-memory sort and improves selectivity by filtering on both status and region.\n\nIf the MongoDB MCP server is not set up, follow best indexing practices.\n\n## Example workflow 2 (general database performance help)\n\n**User:** \"Can you help with optimizing slow queries on my cluster?”\n\n1. **Run atlas-get-performance-advisor:**  \n   - 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.\n   - Use slowQueryLogs to fetch slow query logs from the past 24 hours  \n   - Use suggestedIndexes  \n   - Use dropIndexSuggestions  \n   - Use schemaSuggestions  \n2. **Diagnose and Recommend:** Based on slow query logs and performance advisor advice, you can create the compound index `{status: 1, region: 1, date: -1}` on the `db.orders` collection to optimize queries such as `find({status: 'shipped', region: 'US'}).sort({date: -1})`\n\nExamine all performance advisor output as well as slow query logs. Provide information on what is being improved and why, and focus on suggestions that have the potential for greatest impact (e.g., indexes that affect the most queries, or queries that have the worst performance).\n\n## Load references\n\nBefore beginning diagnosis and recommendation, load reference files.\n\nAlways load:\n\n- `references\u002Fcore-indexing-principles.md`\n- `references\u002Fantipattern-examples.md`\n\nConditionally load these files:\n\n- **If diagnosing aggregation pipelines** → `references\u002Faggregation-optimization.md`\n- **If diagnosing queries that change docs such as replaceOne, findOneAndUpdate, etc.** → `references\u002Fupdate-query-examples.md` for oplog-efficient updates and common update anti-patterns\n\n## Output\n\n- Keep answers short and clear: a few sentences on index and optimization suggestions, and reasoning behind them (e.g. general indexing principles, observing slow query logs in the cluster, or seeing advice in Performance Advisor)\n- Focus on highest impact indexes or optimizations - if you've omitted some optimizations let the user know and present them if asked.\n- Do not use strong language, such as saying “You should create these indexes and they will definitely improve application performance” \\-  Explain they are suggestions for certain queries, and give the reasoning behind them.\n- Consider how many indexes already exist on the collection (if known) \\- there shouldn’t generally be more than 20\n- Suggest removing indexes only if the suggestion comes from Atlas Performance Advisor\n- Do not create indexes directly via MCP unless the user gives approval",{"data":41,"body":45},{"name":4,"description":6,"compatibility":42,"license":26,"metadata":43},"Best with MongoDB MCP server. Uses collection-indexes and explain when the connection string works; uses Atlas Performance Advisor when Atlas API is configured. Without either, suggest indexes from query shape only. User creates indexes in Atlas or migrations unless tooling allows otherwise.",{"version":44},"1.0.0",{"type":46,"children":47},"root",[48,56,63,77,130,142,148,155,160,180,191,197,202,241,246,252,310,320,575,585,747,752,758,783,848,854,881,994,1013,1019,1037,1047,1218,1228,1299,1304,1310,1319,1388,1393,1399,1404,1409,1430,1435,1470,1476],{"type":49,"tag":50,"props":51,"children":52},"element","h1",{"id":4},[53],{"type":54,"value":55},"text","MongoDB Query Optimizer",{"type":49,"tag":57,"props":58,"children":60},"h2",{"id":59},"when-this-skill-is-invoked",[61],{"type":54,"value":62},"When this skill is invoked",{"type":49,"tag":64,"props":65,"children":66},"p",{},[67,69,75],{"type":54,"value":68},"Invoke ",{"type":49,"tag":70,"props":71,"children":72},"strong",{},[73],{"type":54,"value":74},"only",{"type":54,"value":76}," when the user wants:",{"type":49,"tag":78,"props":79,"children":80},"ul",{},[81,100,115],{"type":49,"tag":82,"props":83,"children":84},"li",{},[85,87,92,94,98],{"type":54,"value":86},"Query\u002Findex ",{"type":49,"tag":70,"props":88,"children":89},{},[90],{"type":54,"value":91},"optimization",{"type":54,"value":93}," or ",{"type":49,"tag":70,"props":95,"children":96},{},[97],{"type":54,"value":14},{"type":54,"value":99}," help",{"type":49,"tag":82,"props":101,"children":102},{},[103,108,110],{"type":49,"tag":70,"props":104,"children":105},{},[106],{"type":54,"value":107},"Why",{"type":54,"value":109}," a query is slow or ",{"type":49,"tag":70,"props":111,"children":112},{},[113],{"type":54,"value":114},"how to speed it up",{"type":49,"tag":82,"props":116,"children":117},{},[118,123,125],{"type":49,"tag":70,"props":119,"children":120},{},[121],{"type":54,"value":122},"Slow queries",{"type":54,"value":124}," on their cluster and\u002For ",{"type":49,"tag":70,"props":126,"children":127},{},[128],{"type":54,"value":129},"how to optimize them",{"type":49,"tag":64,"props":131,"children":132},{},[133,135,140],{"type":54,"value":134},"Do ",{"type":49,"tag":70,"props":136,"children":137},{},[138],{"type":54,"value":139},"not",{"type":54,"value":141}," invoke for routine query authoring unless the user has requested help with optimization, slow queries, or indexing.",{"type":49,"tag":57,"props":143,"children":145},{"id":144},"high-level-workflow",[146],{"type":54,"value":147},"High Level Workflow",{"type":49,"tag":149,"props":150,"children":152},"h3",{"id":151},"general-performance-help",[153],{"type":54,"value":154},"General Performance Help",{"type":49,"tag":64,"props":156,"children":157},{},[158],{"type":54,"value":159},"If the user wants to examine slow queries, or is looking for general performance suggestions (not regarding any particular query):",{"type":49,"tag":78,"props":161,"children":162},{},[163,175],{"type":49,"tag":82,"props":164,"children":165},{},[166,168,173],{"type":54,"value":167},"Use MongoDB MCP server ",{"type":49,"tag":70,"props":169,"children":170},{},[171],{"type":54,"value":172},"atlas-get-performance-advisor",{"type":54,"value":174}," tool to fetch slow query logs and performance advisor output",{"type":49,"tag":82,"props":176,"children":177},{},[178],{"type":54,"value":179},"Make suggestions based on this information",{"type":49,"tag":64,"props":181,"children":182},{},[183,185,189],{"type":54,"value":184},"If Atlas MCP Server for Atlas is not configured or you don’t have enough information to run ",{"type":49,"tag":70,"props":186,"children":187},{},[188],{"type":54,"value":172},{"type":54,"value":190}," against the correct cluster, tell the user that general performance analysis requires Atlas MCP Server configuration with API credentials, and suggest they configure it or ask about a specific query instead.",{"type":49,"tag":149,"props":192,"children":194},{"id":193},"help-with-a-specific-query",[195],{"type":54,"value":196},"Help with a Specific Query",{"type":49,"tag":64,"props":198,"children":199},{},[200],{"type":54,"value":201},"If the user is asking about a particular query:",{"type":49,"tag":78,"props":203,"children":204},{},[205,231],{"type":49,"tag":82,"props":206,"children":207},{},[208,210,215,217,222,224,229],{"type":54,"value":209},"Use ",{"type":49,"tag":70,"props":211,"children":212},{},[213],{"type":54,"value":214},"collection-indexes",{"type":54,"value":216},", ",{"type":49,"tag":70,"props":218,"children":219},{},[220],{"type":54,"value":221},"explain",{"type":54,"value":223},", and ",{"type":49,"tag":70,"props":225,"children":226},{},[227],{"type":54,"value":228},"find",{"type":54,"value":230}," MCP tools to get existing indexes on the collection, explain() output for the query, and a sample document from the collection",{"type":49,"tag":82,"props":232,"children":233},{},[234,235,240],{"type":54,"value":209},{"type":49,"tag":70,"props":236,"children":237},{},[238],{"type":54,"value":239},"atlas-get-performance-advisor MCP",{"type":54,"value":174},{"type":49,"tag":64,"props":242,"children":243},{},[244],{"type":54,"value":245},"Then make an optimization suggestion based on collected information and MongoDB best practices and examples from reference files. Prefer creating an index that fully covers the query if possible. If you cannot use MongoDB MCP Server then still try to make a suggestion.",{"type":49,"tag":57,"props":247,"children":249},{"id":248},"mcp-available-tools",[250],{"type":54,"value":251},"MCP: available tools",{"type":49,"tag":64,"props":253,"children":254},{},[255,260,262,267,269,274,276,283,285,290,291,297,299,308],{"type":49,"tag":70,"props":256,"children":257},{},[258],{"type":54,"value":259},"How to invoke.",{"type":54,"value":261}," Call the ",{"type":49,"tag":70,"props":263,"children":264},{},[265],{"type":54,"value":266},"MongoDB MCP server",{"type":54,"value":268}," with the ",{"type":49,"tag":70,"props":270,"children":271},{},[272],{"type":54,"value":273},"exact tool name",{"type":54,"value":275}," as ",{"type":49,"tag":277,"props":278,"children":280},"code",{"className":279},[],[281],{"type":54,"value":282},"toolName",{"type":54,"value":284}," and a single ",{"type":49,"tag":70,"props":286,"children":287},{},[288],{"type":54,"value":289},"arguments object",{"type":54,"value":275},{"type":49,"tag":277,"props":292,"children":294},{"className":293},[],[295],{"type":54,"value":296},"arguments",{"type":54,"value":298},". Do not pass the tool name as an option, query param, or nested key; pass it as the MCP tool name and the parameters as the arguments object. Full MCP Server tool reference: ",{"type":49,"tag":300,"props":301,"children":305},"a",{"href":302,"rel":303},"https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fmcp-server\u002Ftools\u002F",[304],"nofollow",[306],{"type":54,"value":307},"MongoDB MCP Server Tools",{"type":54,"value":309},".",{"type":49,"tag":64,"props":311,"children":312},{},[313,318],{"type":49,"tag":70,"props":314,"children":315},{},[316],{"type":54,"value":317},"Database tools",{"type":54,"value":319}," (when the MCP cluster connection works):",{"type":49,"tag":321,"props":322,"children":323},"table",{},[324,344],{"type":49,"tag":325,"props":326,"children":327},"thead",{},[328],{"type":49,"tag":329,"props":330,"children":331},"tr",{},[332,339],{"type":49,"tag":333,"props":334,"children":336},"th",{"align":335},"left",[337],{"type":54,"value":338},"Tool name (exact)",{"type":49,"tag":333,"props":340,"children":341},{"align":335},[342],{"type":54,"value":343},"Arguments object",{"type":49,"tag":345,"props":346,"children":347},"tbody",{},[348,371,514],{"type":49,"tag":329,"props":349,"children":350},{},[351,360],{"type":49,"tag":352,"props":353,"children":354},"td",{"align":335},[355],{"type":49,"tag":277,"props":356,"children":358},{"className":357},[],[359],{"type":54,"value":214},{"type":49,"tag":352,"props":361,"children":362},{"align":335},[363,369],{"type":49,"tag":277,"props":364,"children":366},{"className":365},[],[367],{"type":54,"value":368},"{ \"database\": \"\u003Cdb>\", \"collection\": \"\u003Ccoll>\" }",{"type":54,"value":370}," — both required strings.",{"type":49,"tag":329,"props":372,"children":373},{},[374,382],{"type":49,"tag":352,"props":375,"children":376},{"align":335},[377],{"type":49,"tag":277,"props":378,"children":380},{"className":379},[],[381],{"type":54,"value":221},{"type":49,"tag":352,"props":383,"children":384},{"align":335},[385,391,393,399,401,407,409,415,416,422,424,430,432,437,439,445,446,452,453,459,461,467,469,475,477,483,485,491,493,499,500,506,507,513],{"type":49,"tag":277,"props":386,"children":388},{"className":387},[],[389],{"type":54,"value":390},"{ \"database\": \"\u003Cdb>\", \"collection\": \"\u003Ccoll>\", \"method\": [ { \"name\": \"find\", \"arguments\": { \"filter\": {...}, \"sort\": {...}, \"limit\": N } } ], \"verbosity\": \"executionStats\" }",{"type":54,"value":392},". ",{"type":49,"tag":277,"props":394,"children":396},{"className":395},[],[397],{"type":54,"value":398},"method",{"type":54,"value":400}," is an array of one object: ",{"type":49,"tag":277,"props":402,"children":404},{"className":403},[],[405],{"type":54,"value":406},"name",{"type":54,"value":408}," is ",{"type":49,"tag":277,"props":410,"children":412},{"className":411},[],[413],{"type":54,"value":414},"\"find\"",{"type":54,"value":216},{"type":49,"tag":277,"props":417,"children":419},{"className":418},[],[420],{"type":54,"value":421},"\"aggregate\"",{"type":54,"value":423},", or ",{"type":49,"tag":277,"props":425,"children":427},{"className":426},[],[428],{"type":54,"value":429},"\"count\"",{"type":54,"value":431},"; ",{"type":49,"tag":277,"props":433,"children":435},{"className":434},[],[436],{"type":54,"value":296},{"type":54,"value":438}," holds that method's params (e.g. find: ",{"type":49,"tag":277,"props":440,"children":442},{"className":441},[],[443],{"type":54,"value":444},"filter",{"type":54,"value":216},{"type":49,"tag":277,"props":447,"children":449},{"className":448},[],[450],{"type":54,"value":451},"sort",{"type":54,"value":216},{"type":49,"tag":277,"props":454,"children":456},{"className":455},[],[457],{"type":54,"value":458},"limit",{"type":54,"value":460},"; aggregate: ",{"type":49,"tag":277,"props":462,"children":464},{"className":463},[],[465],{"type":54,"value":466},"pipeline",{"type":54,"value":468},"; count: ",{"type":49,"tag":277,"props":470,"children":472},{"className":471},[],[473],{"type":54,"value":474},"query",{"type":54,"value":476},"). Optional ",{"type":49,"tag":277,"props":478,"children":480},{"className":479},[],[481],{"type":54,"value":482},"verbosity",{"type":54,"value":484},": ",{"type":49,"tag":277,"props":486,"children":488},{"className":487},[],[489],{"type":54,"value":490},"\"queryPlanner\"",{"type":54,"value":492}," (default), ",{"type":49,"tag":277,"props":494,"children":496},{"className":495},[],[497],{"type":54,"value":498},"\"executionStats\"",{"type":54,"value":216},{"type":49,"tag":277,"props":501,"children":503},{"className":502},[],[504],{"type":54,"value":505},"\"queryPlannerExtended\"",{"type":54,"value":216},{"type":49,"tag":277,"props":508,"children":510},{"className":509},[],[511],{"type":54,"value":512},"\"allPlansExecution\"",{"type":54,"value":309},{"type":49,"tag":329,"props":515,"children":516},{},[517,525],{"type":49,"tag":352,"props":518,"children":519},{"align":335},[520],{"type":49,"tag":277,"props":521,"children":523},{"className":522},[],[524],{"type":54,"value":228},{"type":49,"tag":352,"props":526,"children":527},{"align":335},[528,534,536,541,542,548,549,554,556,562,563,568,569,574],{"type":49,"tag":277,"props":529,"children":531},{"className":530},[],[532],{"type":54,"value":533},"{ \"database\": \"\u003Cdb>\", \"collection\": \"\u003Ccoll>\", \"filter\": {...}, \"projection\": {...}, \"sort\": {...}, \"limit\": N }",{"type":54,"value":535}," — ",{"type":49,"tag":277,"props":537,"children":539},{"className":538},[],[540],{"type":54,"value":19},{"type":54,"value":216},{"type":49,"tag":277,"props":543,"children":545},{"className":544},[],[546],{"type":54,"value":547},"collection",{"type":54,"value":223},{"type":49,"tag":277,"props":550,"children":552},{"className":551},[],[553],{"type":54,"value":444},{"type":54,"value":555}," are required. Optional: ",{"type":49,"tag":277,"props":557,"children":559},{"className":558},[],[560],{"type":54,"value":561},"projection",{"type":54,"value":216},{"type":49,"tag":277,"props":564,"children":566},{"className":565},[],[567],{"type":54,"value":451},{"type":54,"value":216},{"type":49,"tag":277,"props":570,"children":572},{"className":571},[],[573],{"type":54,"value":458},{"type":54,"value":309},{"type":49,"tag":64,"props":576,"children":577},{},[578,583],{"type":49,"tag":70,"props":579,"children":580},{},[581],{"type":54,"value":582},"Atlas tools",{"type":54,"value":584}," (when Atlas API credentials are configured):",{"type":49,"tag":321,"props":586,"children":587},{},[588,602],{"type":49,"tag":325,"props":589,"children":590},{},[591],{"type":49,"tag":329,"props":592,"children":593},{},[594,598],{"type":49,"tag":333,"props":595,"children":596},{"align":335},[597],{"type":54,"value":338},{"type":49,"tag":333,"props":599,"children":600},{"align":335},[601],{"type":54,"value":343},{"type":49,"tag":345,"props":603,"children":604},{},[605,643],{"type":49,"tag":329,"props":606,"children":607},{},[608,617],{"type":49,"tag":352,"props":609,"children":610},{"align":335},[611],{"type":49,"tag":277,"props":612,"children":614},{"className":613},[],[615],{"type":54,"value":616},"atlas-list-projects",{"type":49,"tag":352,"props":618,"children":619},{"align":335},[620,626,627,633,635,641],{"type":49,"tag":277,"props":621,"children":623},{"className":622},[],[624],{"type":54,"value":625},"{}",{"type":54,"value":93},{"type":49,"tag":277,"props":628,"children":630},{"className":629},[],[631],{"type":54,"value":632},"{ \"orgId\": \"\u003C24-char hex>\" }",{"type":54,"value":634},". Returns projects with their IDs; use to get ",{"type":49,"tag":277,"props":636,"children":638},{"className":637},[],[639],{"type":54,"value":640},"projectId",{"type":54,"value":642}," for Performance Advisor.",{"type":49,"tag":329,"props":644,"children":645},{},[646,654],{"type":49,"tag":352,"props":647,"children":648},{"align":335},[649],{"type":49,"tag":277,"props":650,"children":652},{"className":651},[],[653],{"type":54,"value":172},{"type":49,"tag":352,"props":655,"children":656},{"align":335},[657,662,664,670,672,678,680,685,686,692,694,700,701,707,708,714,715,721,723,729,731,737,739,745],{"type":49,"tag":70,"props":658,"children":659},{},[660],{"type":54,"value":661},"Required:",{"type":54,"value":663}," ",{"type":49,"tag":277,"props":665,"children":667},{"className":666},[],[668],{"type":54,"value":669},"\"projectId\"",{"type":54,"value":671}," (24-character hex string), ",{"type":49,"tag":277,"props":673,"children":675},{"className":674},[],[676],{"type":54,"value":677},"\"clusterName\"",{"type":54,"value":679}," (string, 1–64 chars, alphanumeric\u002Funderscore\u002Fdash). ",{"type":49,"tag":70,"props":681,"children":682},{},[683],{"type":54,"value":684},"Optional:",{"type":54,"value":663},{"type":49,"tag":277,"props":687,"children":689},{"className":688},[],[690],{"type":54,"value":691},"\"operations\"",{"type":54,"value":693}," — array of strings from ",{"type":49,"tag":277,"props":695,"children":697},{"className":696},[],[698],{"type":54,"value":699},"\"suggestedIndexes\"",{"type":54,"value":216},{"type":49,"tag":277,"props":702,"children":704},{"className":703},[],[705],{"type":54,"value":706},"\"dropIndexSuggestions\"",{"type":54,"value":216},{"type":49,"tag":277,"props":709,"children":711},{"className":710},[],[712],{"type":54,"value":713},"\"slowQueryLogs\"",{"type":54,"value":216},{"type":49,"tag":277,"props":716,"children":718},{"className":717},[],[719],{"type":54,"value":720},"\"schemaSuggestions\"",{"type":54,"value":722}," (request only what you need); for slowQueryLogs only: ",{"type":49,"tag":277,"props":724,"children":726},{"className":725},[],[727],{"type":54,"value":728},"\"since\"",{"type":54,"value":730}," (ISO 8601 date-time), ",{"type":49,"tag":277,"props":732,"children":734},{"className":733},[],[735],{"type":54,"value":736},"\"namespaces\"",{"type":54,"value":738}," (array of ",{"type":49,"tag":277,"props":740,"children":742},{"className":741},[],[743],{"type":54,"value":744},"\"db.coll\"",{"type":54,"value":746}," strings).",{"type":49,"tag":64,"props":748,"children":749},{},[750],{"type":54,"value":751},"For a user question, try to fetch information from both the connection string and Atlas API related to the query you are optimizing.",{"type":49,"tag":149,"props":753,"children":755},{"id":754},"_1-db-connection-string-works-for-mongodb-mcp",[756],{"type":54,"value":757},"1. DB connection string works for MongoDB MCP",{"type":49,"tag":64,"props":759,"children":760},{},[761,763,768,770,775,776,781],{"type":54,"value":762},"Typical flow: call ",{"type":49,"tag":277,"props":764,"children":766},{"className":765},[],[767],{"type":54,"value":214},{"type":54,"value":769}," → ",{"type":49,"tag":277,"props":771,"children":773},{"className":772},[],[774],{"type":54,"value":221},{"type":54,"value":769},{"type":49,"tag":277,"props":777,"children":779},{"className":778},[],[780],{"type":54,"value":228},{"type":54,"value":782}," (sample doc).",{"type":49,"tag":78,"props":784,"children":785},{},[786,821],{"type":49,"tag":82,"props":787,"children":788},{},[789,797,799,805,807,812,813,819],{"type":49,"tag":70,"props":790,"children":791},{},[792],{"type":49,"tag":277,"props":793,"children":795},{"className":794},[],[796],{"type":54,"value":214},{"type":54,"value":798}," — Use the result's ",{"type":49,"tag":277,"props":800,"children":802},{"className":801},[],[803],{"type":54,"value":804},"classicIndexes",{"type":54,"value":806}," (each has ",{"type":49,"tag":277,"props":808,"children":810},{"className":809},[],[811],{"type":54,"value":406},{"type":54,"value":216},{"type":49,"tag":277,"props":814,"children":816},{"className":815},[],[817],{"type":54,"value":818},"key",{"type":54,"value":820},") to see if the query can already use an existing index.",{"type":49,"tag":82,"props":822,"children":823},{},[824,832,834,839,841,846],{"type":49,"tag":70,"props":825,"children":826},{},[827],{"type":49,"tag":277,"props":828,"children":830},{"className":829},[],[831],{"type":54,"value":221},{"type":54,"value":833}," — Run in ",{"type":49,"tag":277,"props":835,"children":837},{"className":836},[],[838],{"type":54,"value":490},{"type":54,"value":840}," mode first to check for COLLSCAN. If the query uses an index or the collection is very small, run again with ",{"type":49,"tag":277,"props":842,"children":844},{"className":843},[],[845],{"type":54,"value":498},{"type":54,"value":847}," (10-second timeout) to get docs scanned vs. returned.",{"type":49,"tag":149,"props":849,"children":851},{"id":850},"_2-atlas-api-access-works-for-mongodb-mcp",[852],{"type":54,"value":853},"2. Atlas API access works for MongoDB MCP",{"type":49,"tag":64,"props":855,"children":856},{},[857,859,864,866,871,873,879],{"type":54,"value":858},"If you need a project ID, call ",{"type":49,"tag":277,"props":860,"children":862},{"className":861},[],[863],{"type":54,"value":616},{"type":54,"value":865}," first. Then call ",{"type":49,"tag":277,"props":867,"children":869},{"className":868},[],[870],{"type":54,"value":172},{"type":54,"value":872}," with only the ",{"type":49,"tag":277,"props":874,"children":876},{"className":875},[],[877],{"type":54,"value":878},"operations",{"type":54,"value":880}," you need:",{"type":49,"tag":321,"props":882,"children":883},{},[884,900],{"type":49,"tag":325,"props":885,"children":886},{},[887],{"type":49,"tag":329,"props":888,"children":889},{},[890,895],{"type":49,"tag":333,"props":891,"children":892},{"align":335},[893],{"type":54,"value":894},"Operation value",{"type":49,"tag":333,"props":896,"children":897},{"align":335},[898],{"type":54,"value":899},"Use when",{"type":49,"tag":345,"props":901,"children":902},{},[903,943,960,977],{"type":49,"tag":329,"props":904,"children":905},{},[906,915],{"type":49,"tag":352,"props":907,"children":908},{"align":335},[909],{"type":49,"tag":277,"props":910,"children":912},{"className":911},[],[913],{"type":54,"value":914},"slowQueryLogs",{"type":49,"tag":352,"props":916,"children":917},{"align":335},[918,920,925,927,933,935,941],{"type":54,"value":919},"Fetching slow queries—",{"type":49,"tag":70,"props":921,"children":922},{},[923],{"type":54,"value":924},"prioritize by slowest and most frequent",{"type":54,"value":926},". Optional: ",{"type":49,"tag":277,"props":928,"children":930},{"className":929},[],[931],{"type":54,"value":932},"namespaces",{"type":54,"value":934}," to scope to a collection; ",{"type":49,"tag":277,"props":936,"children":938},{"className":937},[],[939],{"type":54,"value":940},"since",{"type":54,"value":942}," for a time window.",{"type":49,"tag":329,"props":944,"children":945},{},[946,955],{"type":49,"tag":352,"props":947,"children":948},{"align":335},[949],{"type":49,"tag":277,"props":950,"children":952},{"className":951},[],[953],{"type":54,"value":954},"suggestedIndexes",{"type":49,"tag":352,"props":956,"children":957},{"align":335},[958],{"type":54,"value":959},"Fetching cluster index recommendations",{"type":49,"tag":329,"props":961,"children":962},{},[963,972],{"type":49,"tag":352,"props":964,"children":965},{"align":335},[966],{"type":49,"tag":277,"props":967,"children":969},{"className":968},[],[970],{"type":54,"value":971},"dropIndexSuggestions",{"type":49,"tag":352,"props":973,"children":974},{"align":335},[975],{"type":54,"value":976},"User asks what to remove or reduce index overhead",{"type":49,"tag":329,"props":978,"children":979},{},[980,989],{"type":49,"tag":352,"props":981,"children":982},{"align":335},[983],{"type":49,"tag":277,"props":984,"children":986},{"className":985},[],[987],{"type":54,"value":988},"schemaSuggestions",{"type":49,"tag":352,"props":990,"children":991},{"align":335},[992],{"type":54,"value":993},"User asks for schema\u002Fquery-structure advice alongside indexes",{"type":49,"tag":64,"props":995,"children":996},{},[997,999,1004,1006,1011],{"type":54,"value":998},"Do not pass the MCP tool name as an ",{"type":49,"tag":277,"props":1000,"children":1002},{"className":1001},[],[1003],{"type":54,"value":878},{"type":54,"value":1005}," value—",{"type":49,"tag":277,"props":1007,"children":1009},{"className":1008},[],[1010],{"type":54,"value":878},{"type":54,"value":1012}," is a separate argument listing what data to fetch.",{"type":49,"tag":57,"props":1014,"children":1016},{"id":1015},"example-workflow-1-help-with-specific-query",[1017],{"type":54,"value":1018},"Example workflow 1 (help with specific query)",{"type":49,"tag":64,"props":1020,"children":1021},{},[1022,1027,1029,1035],{"type":49,"tag":70,"props":1023,"children":1024},{},[1025],{"type":54,"value":1026},"User:",{"type":54,"value":1028}," \"Why is this query slow? ",{"type":49,"tag":277,"props":1030,"children":1032},{"className":1031},[],[1033],{"type":54,"value":1034},"db.orders.find({status: 'shipped', region: 'US'}).sort({date: -1})",{"type":54,"value":1036},"\"",{"type":49,"tag":64,"props":1038,"children":1039},{},[1040,1045],{"type":49,"tag":70,"props":1041,"children":1042},{},[1043],{"type":54,"value":1044},"If MCP db connection is configured and the database + collection names are known",{"type":54,"value":1046},", run steps 1–3. Otherwise skip to step 4.",{"type":49,"tag":1048,"props":1049,"children":1050},"ol",{},[1051,1113,1196],{"type":49,"tag":82,"props":1052,"children":1053},{},[1054,1059],{"type":49,"tag":70,"props":1055,"children":1056},{},[1057],{"type":54,"value":1058},"Check existing collection indexes:",{"type":49,"tag":78,"props":1060,"children":1061},{},[1062,1088],{"type":49,"tag":82,"props":1063,"children":1064},{},[1065,1067,1072,1074,1080,1082],{"type":54,"value":1066},"Call ",{"type":49,"tag":277,"props":1068,"children":1070},{"className":1069},[],[1071],{"type":54,"value":214},{"type":54,"value":1073}," with database=",{"type":49,"tag":277,"props":1075,"children":1077},{"className":1076},[],[1078],{"type":54,"value":1079},"store",{"type":54,"value":1081},", collection=",{"type":49,"tag":277,"props":1083,"children":1085},{"className":1084},[],[1086],{"type":54,"value":1087},"orders",{"type":49,"tag":82,"props":1089,"children":1090},{},[1091,1093,1099,1100,1106,1107],{"type":54,"value":1092},"Result shows: ",{"type":49,"tag":277,"props":1094,"children":1096},{"className":1095},[],[1097],{"type":54,"value":1098},"{_id: 1}",{"type":54,"value":216},{"type":49,"tag":277,"props":1101,"children":1103},{"className":1102},[],[1104],{"type":54,"value":1105},"{status: 1}",{"type":54,"value":216},{"type":49,"tag":277,"props":1108,"children":1110},{"className":1109},[],[1111],{"type":54,"value":1112},"{date: -1}",{"type":49,"tag":82,"props":1114,"children":1115},{},[1116,1121],{"type":49,"tag":70,"props":1117,"children":1118},{},[1119],{"type":54,"value":1120},"Run explain:",{"type":49,"tag":78,"props":1122,"children":1123},{},[1124,1171],{"type":49,"tag":82,"props":1125,"children":1126},{},[1127,1128,1133,1135,1140,1142,1148,1150,1155,1157,1163,1165],{"type":54,"value":1066},{"type":49,"tag":277,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":54,"value":221},{"type":54,"value":1134}," with method=",{"type":49,"tag":277,"props":1136,"children":1138},{"className":1137},[],[1139],{"type":54,"value":228},{"type":54,"value":1141},", filter=",{"type":49,"tag":277,"props":1143,"children":1145},{"className":1144},[],[1146],{"type":54,"value":1147},"{status: 'shipped', region: 'US'}",{"type":54,"value":1149},", sort=",{"type":49,"tag":277,"props":1151,"children":1153},{"className":1152},[],[1154],{"type":54,"value":1112},{"type":54,"value":1156},", verbosity=",{"type":49,"tag":277,"props":1158,"children":1160},{"className":1159},[],[1161],{"type":54,"value":1162},"queryPlanner",{"type":54,"value":1164}," and ",{"type":49,"tag":277,"props":1166,"children":1168},{"className":1167},[],[1169],{"type":54,"value":1170},"executionStats",{"type":49,"tag":82,"props":1172,"children":1173},{},[1174,1176,1181,1183,1189,1190],{"type":54,"value":1175},"Result: Uses ",{"type":49,"tag":277,"props":1177,"children":1179},{"className":1178},[],[1180],{"type":54,"value":1105},{"type":54,"value":1182}," index, then in-memory SORT, ",{"type":49,"tag":277,"props":1184,"children":1186},{"className":1185},[],[1187],{"type":54,"value":1188},"totalKeysExamined: 50000",{"type":54,"value":216},{"type":49,"tag":277,"props":1191,"children":1193},{"className":1192},[],[1194],{"type":54,"value":1195},"nReturned: 100",{"type":49,"tag":82,"props":1197,"children":1198},{},[1199,1204],{"type":49,"tag":70,"props":1200,"children":1201},{},[1202],{"type":54,"value":1203},"Run find:",{"type":49,"tag":78,"props":1205,"children":1206},{},[1207],{"type":49,"tag":82,"props":1208,"children":1209},{},[1210,1211,1216],{"type":54,"value":1066},{"type":49,"tag":277,"props":1212,"children":1214},{"className":1213},[],[1215],{"type":54,"value":228},{"type":54,"value":1217}," with limit=1 to fetch a sample document to impute the schema.",{"type":49,"tag":64,"props":1219,"children":1220},{},[1221,1226],{"type":49,"tag":70,"props":1222,"children":1223},{},[1224],{"type":54,"value":1225},"If MCP Atlas connection is configured",{"type":54,"value":1227},", run step 4. Otherwise skip to step 5.",{"type":49,"tag":1048,"props":1229,"children":1231},{"start":1230},4,[1232,1271,1281],{"type":49,"tag":82,"props":1233,"children":1234},{},[1235,1240],{"type":49,"tag":70,"props":1236,"children":1237},{},[1238],{"type":54,"value":1239},"Run atlas-get-performance-advisor:",{"type":49,"tag":78,"props":1241,"children":1242},{},[1243,1248,1266],{"type":49,"tag":82,"props":1244,"children":1245},{},[1246],{"type":54,"value":1247},"Try to get the cluster name from the MCP connection string, or ask the user for projectId\u002FclusterName",{"type":49,"tag":82,"props":1249,"children":1250},{},[1251,1253,1258,1259,1264],{"type":54,"value":1252},"Use slowQueryLogs to fetch slow query logs from database=",{"type":49,"tag":277,"props":1254,"children":1256},{"className":1255},[],[1257],{"type":54,"value":1079},{"type":54,"value":1081},{"type":49,"tag":277,"props":1260,"children":1262},{"className":1261},[],[1263],{"type":54,"value":1087},{"type":54,"value":1265}," in the past 24 hours",{"type":49,"tag":82,"props":1267,"children":1268},{},[1269],{"type":54,"value":1270},"Use suggestedIndexes to check for index suggestions for the query",{"type":49,"tag":82,"props":1272,"children":1273},{},[1274,1279],{"type":49,"tag":70,"props":1275,"children":1276},{},[1277],{"type":54,"value":1278},"Diagnose:",{"type":54,"value":1280}," Based on explain output and slow query logs, this query targets 100 docs but scans 50K index entries (poor selectivity: 0.002). In-memory sort adds overhead. Index doesn't support both filter fields or sort.",{"type":49,"tag":82,"props":1282,"children":1283},{},[1284,1289,1291,1297],{"type":49,"tag":70,"props":1285,"children":1286},{},[1287],{"type":54,"value":1288},"Recommend:",{"type":54,"value":1290}," Create compound index ",{"type":49,"tag":277,"props":1292,"children":1294},{"className":1293},[],[1295],{"type":54,"value":1296},"{status: 1, region: 1, date: -1}",{"type":54,"value":1298}," following ESR (two equality fields, then sort). This eliminates in-memory sort and improves selectivity by filtering on both status and region.",{"type":49,"tag":64,"props":1300,"children":1301},{},[1302],{"type":54,"value":1303},"If the MongoDB MCP server is not set up, follow best indexing practices.",{"type":49,"tag":57,"props":1305,"children":1307},{"id":1306},"example-workflow-2-general-database-performance-help",[1308],{"type":54,"value":1309},"Example workflow 2 (general database performance help)",{"type":49,"tag":64,"props":1311,"children":1312},{},[1313,1317],{"type":49,"tag":70,"props":1314,"children":1315},{},[1316],{"type":54,"value":1026},{"type":54,"value":1318}," \"Can you help with optimizing slow queries on my cluster?”",{"type":49,"tag":1048,"props":1320,"children":1321},{},[1322,1357],{"type":49,"tag":82,"props":1323,"children":1324},{},[1325,1329],{"type":49,"tag":70,"props":1326,"children":1327},{},[1328],{"type":54,"value":1239},{"type":49,"tag":78,"props":1330,"children":1331},{},[1332,1337,1342,1347,1352],{"type":49,"tag":82,"props":1333,"children":1334},{},[1335],{"type":54,"value":1336},"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.",{"type":49,"tag":82,"props":1338,"children":1339},{},[1340],{"type":54,"value":1341},"Use slowQueryLogs to fetch slow query logs from the past 24 hours",{"type":49,"tag":82,"props":1343,"children":1344},{},[1345],{"type":54,"value":1346},"Use suggestedIndexes",{"type":49,"tag":82,"props":1348,"children":1349},{},[1350],{"type":54,"value":1351},"Use dropIndexSuggestions",{"type":49,"tag":82,"props":1353,"children":1354},{},[1355],{"type":54,"value":1356},"Use schemaSuggestions",{"type":49,"tag":82,"props":1358,"children":1359},{},[1360,1365,1367,1372,1374,1380,1382],{"type":49,"tag":70,"props":1361,"children":1362},{},[1363],{"type":54,"value":1364},"Diagnose and Recommend:",{"type":54,"value":1366}," Based on slow query logs and performance advisor advice, you can create the compound index ",{"type":49,"tag":277,"props":1368,"children":1370},{"className":1369},[],[1371],{"type":54,"value":1296},{"type":54,"value":1373}," on the ",{"type":49,"tag":277,"props":1375,"children":1377},{"className":1376},[],[1378],{"type":54,"value":1379},"db.orders",{"type":54,"value":1381}," collection to optimize queries such as ",{"type":49,"tag":277,"props":1383,"children":1385},{"className":1384},[],[1386],{"type":54,"value":1387},"find({status: 'shipped', region: 'US'}).sort({date: -1})",{"type":49,"tag":64,"props":1389,"children":1390},{},[1391],{"type":54,"value":1392},"Examine all performance advisor output as well as slow query logs. Provide information on what is being improved and why, and focus on suggestions that have the potential for greatest impact (e.g., indexes that affect the most queries, or queries that have the worst performance).",{"type":49,"tag":57,"props":1394,"children":1396},{"id":1395},"load-references",[1397],{"type":54,"value":1398},"Load references",{"type":49,"tag":64,"props":1400,"children":1401},{},[1402],{"type":54,"value":1403},"Before beginning diagnosis and recommendation, load reference files.",{"type":49,"tag":64,"props":1405,"children":1406},{},[1407],{"type":54,"value":1408},"Always load:",{"type":49,"tag":78,"props":1410,"children":1411},{},[1412,1421],{"type":49,"tag":82,"props":1413,"children":1414},{},[1415],{"type":49,"tag":277,"props":1416,"children":1418},{"className":1417},[],[1419],{"type":54,"value":1420},"references\u002Fcore-indexing-principles.md",{"type":49,"tag":82,"props":1422,"children":1423},{},[1424],{"type":49,"tag":277,"props":1425,"children":1427},{"className":1426},[],[1428],{"type":54,"value":1429},"references\u002Fantipattern-examples.md",{"type":49,"tag":64,"props":1431,"children":1432},{},[1433],{"type":54,"value":1434},"Conditionally load these files:",{"type":49,"tag":78,"props":1436,"children":1437},{},[1438,1453],{"type":49,"tag":82,"props":1439,"children":1440},{},[1441,1446,1447],{"type":49,"tag":70,"props":1442,"children":1443},{},[1444],{"type":54,"value":1445},"If diagnosing aggregation pipelines",{"type":54,"value":769},{"type":49,"tag":277,"props":1448,"children":1450},{"className":1449},[],[1451],{"type":54,"value":1452},"references\u002Faggregation-optimization.md",{"type":49,"tag":82,"props":1454,"children":1455},{},[1456,1461,1462,1468],{"type":49,"tag":70,"props":1457,"children":1458},{},[1459],{"type":54,"value":1460},"If diagnosing queries that change docs such as replaceOne, findOneAndUpdate, etc.",{"type":54,"value":769},{"type":49,"tag":277,"props":1463,"children":1465},{"className":1464},[],[1466],{"type":54,"value":1467},"references\u002Fupdate-query-examples.md",{"type":54,"value":1469}," for oplog-efficient updates and common update anti-patterns",{"type":49,"tag":57,"props":1471,"children":1473},{"id":1472},"output",[1474],{"type":54,"value":1475},"Output",{"type":49,"tag":78,"props":1477,"children":1478},{},[1479,1484,1489,1494,1499,1504],{"type":49,"tag":82,"props":1480,"children":1481},{},[1482],{"type":54,"value":1483},"Keep answers short and clear: a few sentences on index and optimization suggestions, and reasoning behind them (e.g. general indexing principles, observing slow query logs in the cluster, or seeing advice in Performance Advisor)",{"type":49,"tag":82,"props":1485,"children":1486},{},[1487],{"type":54,"value":1488},"Focus on highest impact indexes or optimizations - if you've omitted some optimizations let the user know and present them if asked.",{"type":49,"tag":82,"props":1490,"children":1491},{},[1492],{"type":54,"value":1493},"Do not use strong language, such as saying “You should create these indexes and they will definitely improve application performance” -  Explain they are suggestions for certain queries, and give the reasoning behind them.",{"type":49,"tag":82,"props":1495,"children":1496},{},[1497],{"type":54,"value":1498},"Consider how many indexes already exist on the collection (if known) - there shouldn’t generally be more than 20",{"type":49,"tag":82,"props":1500,"children":1501},{},[1502],{"type":54,"value":1503},"Suggest removing indexes only if the suggestion comes from Atlas Performance Advisor",{"type":49,"tag":82,"props":1505,"children":1506},{},[1507],{"type":54,"value":1508},"Do not create indexes directly via MCP unless the user gives approval",{"items":1510,"total":1598},[1511,1526,1536,1549,1561,1568,1581],{"slug":1512,"name":1512,"fn":1513,"description":1514,"org":1515,"tags":1516,"stars":23,"repoUrl":24,"updatedAt":1525},"mongodb-atlas-stream-processing","manage MongoDB Atlas Stream Processing workflows","Manages MongoDB Atlas Stream Processing (ASP) workflows. Handles workspace provisioning, data source\u002Fsink connections, processor lifecycle operations, debugging diagnostics, and tier sizing. Supports Kafka, Atlas clusters, S3, HTTPS, and Lambda integrations for streaming data workloads and event processing. NOT for general MongoDB queries or Atlas cluster management. Requires MongoDB MCP Server with Atlas API credentials.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1517,1520,1523,1524],{"name":1518,"slug":1519,"type":15},"Data Engineering","data-engineering",{"name":1521,"slug":1522,"type":15},"Data Pipeline","data-pipeline",{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},"2026-07-13T06:15:32.953796",{"slug":1527,"name":1527,"fn":1528,"description":1529,"org":1530,"tags":1531,"stars":23,"repoUrl":24,"updatedAt":1535},"mongodb-connection","configure MongoDB client connections","Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill when working\u002Fupdating\u002Freviewing on functions that instantiate or configure a MongoDB client (eg, when calling `connect()`), configuring connection pools, troubleshooting connection errors (ECONNREFUSED, timeouts, pool exhaustion), optimizing performance issues related to connections. This includes scenarios like building serverless functions with MongoDB, creating API endpoints that use MongoDB, optimizing high-traffic MongoDB applications, creating long-running tasks and concurrency, or debugging connection-related failures.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1532,1533,1534],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-13T06:15:26.144554",{"slug":1537,"name":1537,"fn":1538,"description":1539,"org":1540,"tags":1541,"stars":23,"repoUrl":24,"updatedAt":1548},"mongodb-mcp-setup","configure MongoDB MCP server","Guide users through configuring key MongoDB MCP server options. Use this skill when a user has the MongoDB MCP server installed but hasn't configured the required environment variables, or when they ask about connecting to MongoDB\u002FAtlas and don't have the credentials set up.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1542,1545,1547],{"name":1543,"slug":1544,"type":15},"Configuration","configuration",{"name":1546,"slug":33,"type":15},"MCP",{"name":9,"slug":8,"type":15},"2026-07-16T06:00:24.26424",{"slug":1550,"name":1550,"fn":1551,"description":1552,"org":1553,"tags":1554,"stars":23,"repoUrl":24,"updatedAt":1560},"mongodb-natural-language-querying","generate MongoDB queries from natural language","Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate MongoDB queries, wants to filter\u002Fquery\u002Faggregate data in MongoDB, asks \"how do I query...\", needs help with query syntax, or discusses finding\u002Ffiltering\u002Fgrouping MongoDB documents. Also use for translating SQL-like requests to MongoDB syntax. Does NOT handle Atlas Search ($search operator), vector\u002Fsemantic search ($vectorSearch operator), fuzzy matching, autocomplete indexes, or relevance scoring - use search-and-ai for those. Does NOT analyze or optimize existing queries - use mongodb-query-optimizer for that. Does NOT handle aggregation pipelines that involve write operations. Requires MongoDB MCP server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1555,1558,1559],{"name":1556,"slug":1557,"type":15},"Data Analysis","data-analysis",{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},"2026-07-16T06:02:02.491655",{"slug":4,"name":4,"fn":5,"description":6,"org":1562,"tags":1563,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1564,1565,1566,1567],{"name":18,"slug":19,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":1569,"name":1569,"fn":1570,"description":1571,"org":1572,"tags":1573,"stars":23,"repoUrl":24,"updatedAt":1580},"mongodb-schema-design","design and optimize MongoDB schemas","MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues caused by schema problems. Triggers on \"design schema\", \"embed vs reference\", \"MongoDB data model\", \"schema review\", \"unbounded arrays\", \"one-to-many\", \"tree structure\", \"16MB limit\", \"schema validation\", \"JSON Schema\", \"time series\", \"schema migration\", \"polymorphic\", \"TTL\", \"data lifecycle\", \"archive\", \"index explosion\", \"unnecessary indexes\", \"approximation pattern\", \"document versioning\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1574,1577,1578,1579],{"name":1575,"slug":1576,"type":15},"Data Modeling","data-modeling",{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-16T06:00:24.782785",{"slug":1582,"name":1582,"fn":1583,"description":1584,"org":1585,"tags":1586,"stars":23,"repoUrl":24,"updatedAt":1597},"mongodb-search-and-ai","implement Atlas Search and Vector Search","Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG applications), or combined approaches. Also use when users need text containment, substring matching ('contains', 'includes', 'appears in'), case-insensitive or multi-field text search, or filtering across many fields with variable combinations. Provides workflows for selecting the right search type, creating indexes, constructing queries, and optimizing performance using the MongoDB MCP server.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1587,1590,1591,1594],{"name":1588,"slug":1589,"type":15},"LLM","llm",{"name":9,"slug":8,"type":15},{"name":1592,"slug":1593,"type":15},"RAG","rag",{"name":1595,"slug":1596,"type":15},"Search","search","2026-07-16T06:01:58.645908",7,{"items":1600,"total":1682},[1601,1608,1614,1620,1626,1633,1640,1647,1664],{"slug":1512,"name":1512,"fn":1513,"description":1514,"org":1602,"tags":1603,"stars":23,"repoUrl":24,"updatedAt":1525},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1604,1605,1606,1607],{"name":1518,"slug":1519,"type":15},{"name":1521,"slug":1522,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"slug":1527,"name":1527,"fn":1528,"description":1529,"org":1609,"tags":1610,"stars":23,"repoUrl":24,"updatedAt":1535},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1611,1612,1613],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":1537,"name":1537,"fn":1538,"description":1539,"org":1615,"tags":1616,"stars":23,"repoUrl":24,"updatedAt":1548},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1617,1618,1619],{"name":1543,"slug":1544,"type":15},{"name":1546,"slug":33,"type":15},{"name":9,"slug":8,"type":15},{"slug":1550,"name":1550,"fn":1551,"description":1552,"org":1621,"tags":1622,"stars":23,"repoUrl":24,"updatedAt":1560},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1623,1624,1625],{"name":1556,"slug":1557,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":1627,"tags":1628,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1629,1630,1631,1632],{"name":18,"slug":19,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":1569,"name":1569,"fn":1570,"description":1571,"org":1634,"tags":1635,"stars":23,"repoUrl":24,"updatedAt":1580},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1636,1637,1638,1639],{"name":1575,"slug":1576,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":1582,"name":1582,"fn":1583,"description":1584,"org":1641,"tags":1642,"stars":23,"repoUrl":24,"updatedAt":1597},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1643,1644,1645,1646],{"name":1588,"slug":1589,"type":15},{"name":9,"slug":8,"type":15},{"name":1592,"slug":1593,"type":15},{"name":1595,"slug":1596,"type":15},{"slug":1648,"name":1648,"fn":1649,"description":1650,"org":1651,"tags":1652,"stars":1661,"repoUrl":1662,"updatedAt":1663},"kafka-to-asp","migrate Kafka connectors to Atlas Stream Processing","Converts MongoDB Kafka managed connector configurations (MongoDbAtlasSource \u002F MongoDbAtlasSink) to equivalent Atlas Stream Processing processors. One-time migration workflow: reads connector JSON, validates it, maps fields to ASP pipeline stages, and creates connections and processors via the MongoDB MCP Server. Requires MongoDB MCP Server with Atlas API credentials.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1653,1654,1657,1660],{"name":1521,"slug":1522,"type":15},{"name":1655,"slug":1656,"type":15},"ETL","etl",{"name":1658,"slug":1659,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},10,"https:\u002F\u002Fgithub.com\u002Fmongodb\u002FASP_example","2026-07-16T06:02:02.15744",{"slug":1665,"name":1665,"fn":1666,"description":1667,"org":1668,"tags":1669,"stars":1679,"repoUrl":1680,"updatedAt":1681},"tines","manage Tines security automation workflows","Use when creating, modifying, or managing Tines stories, actions, workflows, or automations. Also use when the user mentions Tines, asks about building SOAR workflows, or wants to automate security operations. Triggers on keywords like tines, story, action, webhook, workflow automation, SOAR.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1670,1673,1676],{"name":1671,"slug":1672,"type":15},"Automation","automation",{"name":1674,"slug":1675,"type":15},"Security","security",{"name":1677,"slug":1678,"type":15},"Workflow Automation","workflow-automation",1,"https:\u002F\u002Fgithub.com\u002Fmongodb\u002Ftines-claude","2026-07-13T06:15:24.618317",9]