List Distinct Values
distinct_valuesRetrieve distinct values for a field in a MongoDB collection, optionally filtered by a query, to identify unique entries for analysis.
Instructions
List the distinct values of a field in a MongoDB collection, optionally within a filter
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collection": "<collection>",
"field": "<field>"
},
"name": "distinct_values"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | Field path, e.g. status or address.city | |
| filter | No | Query filter as MongoDB Extended JSON, e.g. {"status": "active", "_id": {"$oid": "..."}} | |
| database | No | Optional database to read from for this call only, without changing the active connection | |
| collection | Yes | Collection name |