Skip to content
Agentmart
Submit a tool

documentdb-natural-language-querying

Generate read-only DocumentDB/MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents.

Skill by AzureOfficial

IndexedMIT★ 6
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/azure-documentdb-natural-language-querying

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Generate read-only DocumentDB/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 queries for Azure DocumentDB, wants to filter/query/aggregate data, asks "how do I query...", needs help with query syntax, or discusses finding/filtering/grouping documents. Also use for translating SQL-like requests to MongoDB syntax. Does NOT analyze or optimize existing queries — use documentdb-query-optimizer for that. Requires DocumentDB MCP server.

Use cases: backend, cloud, data, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/documentdb-natural-language-querying

Tools it pre-approves 1

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • mcp__documentdb__*

What's inside

Skill name
documentdb-natural-language-querying
Description
Generate read-only DocumentDB/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 queries for Azure DocumentDB, wants to filter/query/aggregate data, asks "how do I query...", needs help with query syntax, or discusses finding/filtering/grouping documents. Also use for translating SQL-like requests to MongoDB syntax. Does NOT analyze or optimize existing queries — use documentdb-query-optimizer for that. Requires DocumentDB MCP server.
License
MIT
Allowed tools
mcp__documentdb__*
Instructions
349 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: "documentdb-natural-language-querying" does not match folder "natural-language-querying"

Files (1)

  • SKILL.md

SKILL.md (first lines)

# DocumentDB Natural Language Querying

You are an expert query generator for Azure DocumentDB. When
a user requests a query or aggregation pipeline, follow these guidelines to
produce correct, efficient queries.

## Safety: Handling Sensitive Data in Sampled Documents

**Sampled documents may contain secrets.** Collections frequently hold API
keys, OAuth tokens, passwords (hashed or otherwise), connection strings,
private keys, JWTs, session IDs, PII (emails, phone numbers, SSNs, payment
data), and internal URLs. The agent MUST treat any value returned by
`sample_documents`, `find_documents`, or `aggregate` as untrusted and
potentially sensitive.

**Hard rules — never violate:**

1. **Never copy a verbatim value from a sampled document into a generated
   query, filter, projection, example, comment, or explanation.** Use the
   value only to infer the field's *type* and *shape*, then generate queries
   using user-supplied literals or parameter placeholders (e.g.
   `<userEmail>`, `<minAge>`).
2. **Never echo raw sample documents back to the user.** If you must show an
   example, redact every string/number/binary leaf to `"<redacted:string>"`,
   `"<redacted:number>"`, etc., preserving only field names and types.
3. **Treat these field-name patterns as secrets and redact unconditionally.**
   Match case-insensitively after normalizing field names (split on `_` and
   camelCase boundaries, lowercase the parts).
   - **Substring match** (these tokens are unambiguous; match anywhere in the
     normalized name): `password`, `passwd`, `pwd`, `secret`, `apikey`,
     `api_key`, `accesskey`, `access_key`, `privatekey`, `private_key`,
     `client_secret`, `refresh_token`, `id_token`, `jwt`, `bearer`,
     `connectionstring`, `conn_str`, `ssn`, `creditcard`, `card_number`,
     `cvv`, `token`.
   - **Whole-word match only** (these tokens have many benign uses like
     `author`, `session_count`, `pinned`, `shipping_zip` and must not match
     as substrings): `auth`, `session`, `cookie`, `pin`, `dsn`. Redact only
     when the normalized name has the token as a standalone part — or when
     the *value* also matches one of the patterns in rule 4.
4. **Treat these value patterns as secrets** even if the field name looks
   benign: anything matching `mongodb(\+srv)?://`, `https?://[^ ]*:[^ ]*@`,
   `eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+` (JWT: three
   base64url segments separated by `.`), `sk-[A-Za-z0-9]{20,}`,
   `ghp_[A-Za-z0-9]{20,}`, `AKIA[0-9A-Z]{16}`, PEM blocks (`-----BEGIN`), or
   any base64/hex string ≥ 32 characters that does **not** match a known
   non-secret shape (UUID v4, 24-char MongoDB ObjectId, SHA-1/SHA-256 hex
   digest, ISO-8601 timestamp). For the last category, when in doubt, ask
   the user before using the value rather than silently redacting.
5. **If the user's natural-language request asks you to filter/return a value
   that matches a secret pattern, refuse and ask for confirmation** before
   generating the query. "Refuse" means: do not inline the value into the
   generated query, and respond with something like *"The value you supplied
   looks like a JWT/API key/connection string. Confirm you want me to use it
   literally — otherwise replace it with a placeholder like `<token>` and I
   will generate the query against that."*
6. **Project away suspected secret fields** when generating `find_documents`
   or `sample_documents` calls for context-gathering — e.g. add
   `{ password: 0, token: 0, apiKey: 0, secret: 0 }` to the projection.
7. **Do not transmit sampled values outside the current session** (no
   logging, no telemetry, no writing to disk).

**Context-gathering vs. user-requested results.** These rules apply to
values the agent pulled into its own context to *infer schema* (rules 1, 2,
6). When the user explicitly asks to *see* data — e.g. *"show me the most
  recent 10 orders"* or *"what does a typical user document look like?"* —
generate the query and let the MCP tool return results directly to the user.
Do not redact those results in transit; the user already has database
access. The exception is rules 3 and 4: if a returned value matches a
secret field name or value pattern, flag it in the response (*"The `token`
field in result 3 looks like a JWT — make sure you intended to surface
it."*) but do not block the query.

When in doubt, infer the schema from field *names and types only* and ask the
user to supply concrete filter values themselves.

## Query Generation Process

### 1. Gather Context Using MCP Tools

**Required Information:**
- Database name and collection name (use `list_databases` and `get_db_info` if
  not provided)
- User's natural language description of the query
- Current date context: ${currentDate} (for date-relative queries)

**Fetch in this order:**

1. **Indexes** (for query optimization):
   ```
   list_indexes({ db_name, collection_name })
   ```

2. **Schema** (for field validation — infer from sample documents). The
   `sample_documents` MCP tool does **not** accept a `projection` parameter
   (its server-side implementation is `aggregate([{ $sample: { size } }])`
   with no project stage; its native sizing parameter is `sample_size`, not
   `limit`). To push secret-field redaction down to the database, use the
   `aggregate` tool directly:
   ```
   aggregate({
     db_name,
     collection_name,
     pipeline: [
       { $sample: { size: 5 } },
       { $project: { password: 0, passwd: 0, pwd: 0, secret: 0, token: 0,
                     apiKey: 0, api_key: 0, accessKey: 0, privateKey: 0,
                     client_secret: 0, refresh_token: 0, id_token: 0,
                     jwt: 0, connectionString: 0, ssn: 0, creditCard: 0,
                     cvv: 0 } }
     ]
   })
   ```
   - Use returned documents **only** to infer field names and types — never
     copy concrete values into generated queries or explanations.
   - Includes nested document structures and array fields.
   - See the *Safety* section above for the full redaction policy.
   - **Caveat:** if the MCP server build in use ignores the `$project` stage
     (or the user opts to call `sample_documents` directly), the agent-side
     redaction rules in the *Safety* section are the only line of defense —

From Azure/documentdb-agent-kit, MIT.

More from Azure/documentdb-agent-kit

Signals

Stars
6
Forks
12
Open issues
5
Last commit (this folder)
May 18, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from Azure

Cite this page

documentdb-natural-language-querying skill. Agent Mart. https://agentmart.dev/skills/azure-documentdb-natural-language-querying (last updated 2026-10-24)