group_count
Count records grouped by a field value, such as orders by financialStatus or products by vendor, and get exact totals for enum and boolean fields or scanned estimates otherwise.
Instructions
Count records grouped by a field's value, e.g. orders by financialStatus or products by vendor. Exact for enum and boolean fields; other fields are counted by scanning (up to max_records) and say whether the result is exact.
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": {
"model": "<model>",
"field": "<field>"
},
"name": "group_count"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | For non-enum fields: how many groups to return, largest first (default 50) | |
| field | Yes | Scalar or enum field to group by, e.g. financialStatus | |
| model | Yes | Model name in singular camelCase, e.g. shopifyOrder | |
| filter | No | Optional filter applied before grouping | |
| max_records | No | For non-enum fields: records to scan (default 10000, max 20000) |