
Mongodb Natural Language Querying
mongodb/agent-skillsOfficial
Generate read-only MongoDB find queries and aggregation pipelines from natural language, grounded in live schema and samples.
- skills.sh installs
- 5K
- GitHub stars
- 207
- last updated
- Aug 21, 2026
What it does
- Covers find queries and aggregation pipelines, choosing find when filtering, sorting, or projecting alone is sufficient
- Fetches indexes, a schema sample of 50 documents, and 4 sample documents via the MongoDB MCP server before writing a query
- Enforces validated field names, avoids
$whereand unindexed$text, and drops redundant$existschecks - Excludes Atlas Search, vector search, and query optimization; those are routed to
search-and-aiandmongodb-query-optimizer
Install
$ npx -y skills add mongodb/agent-skills --skill mongodb-natural-language-querying -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
MongoDB Natural Language Querying
You are an expert MongoDB read-only query and aggregation pipeline generator.
Query Generation Process
1. Gather Context Using MCP Tools
Required Information:
- Database name and collection name (use
mcp__mongodb__list-databasesandmcp__mongodb__list-collectionsif not provided) - User's natural language description of the query
Fetch in this order:
-
Indexes (for query optimization):
mcp__mongodb__collection-indexes({ database, collection }) -
Schema (for field validation):
mcp__mongodb__collection-schema({ database, collection, sampleSize: 50 })- Returns flattened schema with field names and types
- Includes nested document structures and array fields
-
Sample documents (for understanding data patterns):
mcp__mongodb__find({ database, collection, limit: 4 })- Shows actual data values and formats
- Reveals common patterns (enums, ranges, etc.)
2. Analyze Context and Validate Fields
Details
- Repository
- github.com/mongodb/agent-skills
- Categories
- Databases, AI Agents & LLM Apps
- First seen
- May 16, 2026
More from mongodb/agent-skills
All 8Similar to Mongodb Natural Language Querying
More Databases
mongodb-query-optimizerSkillmongodb/agent-skills7.7K installsTargeted MongoDB query and index optimization that runs only when a user asks for performance help.
mongodb-search-and-aiSkillmongodb/agent-skills6.3K installsSearch features in MongoDB, covering Atlas Search (full-text), Vector Search (semantic), and Hybrid Search with guided setup.
mongodbSkillhoodini/ai-agents-skills1.7K installsPractical MongoDB and Mongoose guidance covering schema design, query operators, updates, and aggregation pipelines with production-minded defaults.
mongoose-mongodbSkillpluginagentmarketplace/custom-plugin-nodejs702 installsGuide to MongoDB in Node.js with Mongoose for schemas, CRUD, relationships, and aggregation queries.
QueryweaverMCP serverfalkordb1.1K starsText-to-SQL access to connected databases, with schema-aware query generation over a graph of tables.