get_distinct_values
Retrieve unique values from a specified field in a MongoDB collection to analyze data distribution, identify categories, check quality, or detect anomalies within filtered datasets.
Instructions
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) |
Input Schema (JSON Schema)
{
"properties": {
"collection": {
"description": "Collection name",
"type": "string"
},
"database": {
"description": "Database name (optional if default database is configured)",
"type": "string"
},
"field": {
"description": "Field name to get distinct values for",
"type": "string"
},
"filter": {
"description": "MongoDB query filter to apply before getting distinct values (optional)",
"type": "object"
}
},
"required": [
"collection",
"field"
],
"type": "object"
}