get_incident_stats
Count incidents by group (e.g., priority, assignment group) with optional ServiceNow query filter. Get per-group totals sorted descending for reporting.
Instructions
Count incidents grouped by a field. Use for "how many", "which group has most", reporting.
Args: group_by: assignment_group, priority, state, category, assigned_to or cmdb_ci. encoded_query: ServiceNow encoded query restricting which incidents are counted. Defaults to active incidents only. Examples: "active=true^priority<=2", "opened_at>2026-08-22 00:00:00".
Returns counts per group, largest first. Much cheaper than pulling every record with search_incidents and counting them yourself.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_incident_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_by | No | assignment_group | |
| encoded_query | No | active=true |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |