run_aggregate_query
Run grouped aggregate queries (COUNT, SUM, AVG, MIN, MAX) on any ServiceNow table to summarize data by fields like priority, state, or assignment group.
Instructions
Run a grouped aggregate (COUNT, SUM, AVG) query on any table (latest release: /api/now/stats/{table})
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>",
"group_by": "<group_by>"
},
"name": "run_aggregate_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max groups (default: 20) | |
| query | No | Optional encoded query filter | |
| table | Yes | Table to query (e.g., "incident", "task_sla") | |
| group_by | Yes | Field to group results by (e.g., "priority", "state", "assignment_group") | |
| aggregate | No | Aggregate function: COUNT (default), SUM, AVG, MIN, MAX |