sn_aggregate
Calculate COUNT, SUM, AVG, MIN, or MAX statistics for any ServiceNow table, with optional grouping, returning aggregate results without fetching individual records.
Instructions
Run COUNT/SUM/AVG/MIN/MAX on any table with optional group_by. Returns stats without fetching records.
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": {
"table": "<table>"
},
"name": "sn_aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | No | Field for SUM/AVG/MIN/MAX | |
| query | No | Encoded query, not SQL: active=true^priority=1. | |
| table | Yes | ||
| group_by | No | Group by field | |
| aggregate | No | COUNT, SUM, AVG, MIN, MAX | COUNT |
| group_limit | No | Max groups listed, largest first. The rest are counted, not listed. |