Title97/100
Aggregate Records
The title clearly communicates the tool’s action and subject. Keep it concise.
Description95/100
Compute totals over a find scope without paging rows. With `aggregates`: count / countDistinct / sum / min / max / average / weightedAverage, optionally per `groupBy` field. With `field`: the distinct values of one field. Use this for KPIs and breakdowns instead of summing `find` pages. With `aggregates`, returns `type` "aggregates", `total` (one value per aggregate) and, with `groupBy`, `groups` of { key, values }. Amounts with a currency or unit are returned per currency/unit in `partitions`, never added together. With `field`, returns `type` "distinct", `field`, and `values` (the distinct non-null values).
The description explains the capability, when to use it, and what to expect.
Inputs88/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
tableUid
The table UID from list_tables (e.g. "salesorders").
Clear enough to supply this argument.
query › pagination › page
Page number, starting at 1 (default 1).
Clear enough to supply this argument.
query › pagination › pageSize
Records per page; with `page` it selects which records come back. Omit it for 50 per page; a larger page is served as 50. `limit`, and `page`/`pageSize`/`offset` beside the filters, work too.
Clear enough to supply this argument.
query › sort › items › id
Field UID to sort by, from describe_table `fields`.
Clear enough to supply this argument.
query › sort › items › desc
true sorts that field descending, false ascending.
Clear enough to supply this argument.
query › filters › items › field
Column this condition tests. Its UID is a field from describe_table `fields`.
Clear enough to supply this argument.
query › filters › items › operator
How `field` is compared with `value`. A list operator takes a JSON array as `value`; compare with null to test an empty field.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › filters › items › value
What `field` is compared with, e.g. "open", "42", "true", "null" or ["a","b"]. The text converts to the field type when the query runs.
Clear enough to supply this argument.
query › or › items › field
Column this condition tests. Its UID is a field from describe_table `fields`.
Clear enough to supply this argument.
query › or › items › operator
How `field` is compared with `value`. A list operator takes a JSON array as `value`; compare with null to test an empty field.
Clear enough to supply this argument.
query › or › items › value
What `field` is compared with, e.g. "open", "42", "true", "null" or ["a","b"]. The text converts to the field type when the query runs.
Clear enough to supply this argument.
query › orGroups › items › items › field
Column this condition tests. Its UID is a field from describe_table `fields`.
Clear enough to supply this argument.
query › orGroups › items › items › operator
How `field` is compared with `value`. A list operator takes a JSON array as `value`; compare with null to test an empty field.
Clear enough to supply this argument.
query › orGroups › items › items › value
What `field` is compared with, e.g. "open", "42", "true", "null" or ["a","b"]. The text converts to the field type when the query runs.
Clear enough to supply this argument.
query › not › items › field
Column this condition tests. Its UID is a field from describe_table `fields`.
Clear enough to supply this argument.
query › not › items › operator
How `field` is compared with `value`. A list operator takes a JSON array as `value`; compare with null to test an empty field.
Clear enough to supply this argument.
query › not › items › value
What `field` is compared with, e.g. "open", "42", "true", "null" or ["a","b"]. The text converts to the field type when the query runs.
Clear enough to supply this argument.
query › exists › items › relation
The related rows to test: a relation key from describe_table `relations` (e.g. "items").
Clear enough to supply this argument.
query › exists › items › field
Column on the related table that this condition tests. Use a field UID of that table.
Clear enough to supply this argument.
query › exists › items › operator
How the related field is compared with the value, in the same way as a filter on this table.
Clear enough to supply this argument.
query › exists › items › value
The value the related field is compared with, written the same way as a filter value.
Clear enough to supply this argument.
query › search
Text search, e.g. "acme". Words are ANDed. Searched in the table's search columns.
Clear enough to supply this argument.
query › searchColumns
Field UIDs to search in instead of the table's search columns.
Clear enough to supply this argument.
query › with
Related rows to embed in each result, by relation key from describe_table `relations` (e.g. ["customer"]).
Clear enough to supply this argument.
query › dateRange › field
The date field UID the range applies to.
Clear enough to supply this argument.
query › dateRange › start
Earliest date to include (ISO 8601). Omit for no lower bound.
Clear enough to supply this argument.
query › dateRange › end
Latest date to include (ISO 8601). Omit for no upper bound.
Clear enough to supply this argument.
aggregates › items › op
The aggregate function applied to `value.var` (count needs no field).
Clear enough to supply this argument.
aggregates › items › alias
Name of this aggregate in `total` and in each group `values` (letters, digits, underscore). Default: its position ("0", "1", …).
Clear enough to supply this argument.
aggregates › items › value › var
Field UID to aggregate. Omit for count.
Clear enough to supply this argument.
aggregates › items › weight › var
Weight field UID. weightedAverage only.
Clear enough to supply this argument.
groupBy
Field UID to break the aggregates down by. Omit for one overall total.
Clear enough to supply this argument.
field
Field UID whose distinct values to list (use instead of aggregates).
Clear enough to supply this argument.
boundary
Act only through your roles at this boundary: `<kind>/<id>` where kind is one of companies, sites, teams (e.g. "teams/<teamId>"), or "*" for the organization-wide roles. It narrows access and never adds it. Without it the call acts through every role you hold. To create a record at a site or team, set its column (e.g. `teamId`) instead.
Clear enough to supply this argument.
Annotations100/100
All four behavior hints are declared.
{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}Output schema72/100
The output schema explains the structured result.
View output schema
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"aggregates",
"distinct"
],
"type": "string",
"description": "Which aggregate result this is."
},
"field": {
"type": "string",
"description": "The field whose distinct values were listed."
},
"total": {
"anyOf": [
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
{
"type": "number"
}
],
"description": "One value per aggregate. Present for `aggregates`."
},
"groups": {
"type": "array",
"items": {
"type": "object",
"required": [
"key",
"values"
],
"properties": {
"key": {
"type": "string",
"description": "The groupBy value."
},
"values": {
"type": "object",
"description": "One value per aggregate in this group that does not split by currency or unit.",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"partitions": {
"type": "object",
"description": "Per currency or unit inside this group.",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "object",
"required": [
"field",
"values"
],
"properties": {
"field": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "object",
"required": [
"key",
"value",
"rows"
],
"properties": {
"key": {
"type": "string"
},
"rows": {
"type": "number"
},
"value": {}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"description": "Present when `groupBy` is set."
},
"values": {
"type": "array",
"items": {
"type": "string"
},
"description": "Distinct non-null values. Present for `field`."
},
"partitions": {
"type": "object",
"description": "Per currency or unit. Present when an aggregate must not mix them. `total` is null for those keys.",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "object",
"required": [
"field",
"values"
],
"properties": {
"field": {
"type": "string",
"description": "The currency or unit field this aggregate is split by."
},
"values": {
"type": "array",
"items": {
"type": "object",
"required": [
"key",
"value",
"rows"
],
"properties": {
"key": {
"type": "string",
"description": "The currency or unit. Empty when the row has none."
},
"rows": {
"type": "number",
"description": "Rows in this currency or unit."
},
"value": {
"description": "The aggregate for this currency or unit."
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}