MongoDB MCP Server
by jonfreeland
get_distinct_values
Get distinct values for a field in a collection.
Useful for:
- Understanding data distribution
- Finding unique categories
- Data quality checks
- Identifying outliers
Example: use_mcp_tool with server_name: "mongodb", tool_name: "get_distinct_values", arguments: { "collection": "users", "field": "role", "filter": { "active": true } }
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection | Yes | Collection name | |
database | No | Database name (optional if default database is configured) | |
field | Yes | Field name to get distinct values for | |
filter | No | MongoDB query filter to apply before getting distinct values (optional) |