query_statistics
Server-side aggregate stats on a numeric field of a FeatureServer layer.
No records fetched — AGOL computes sum/avg/min/max/count (also stddev/var).
Optional WHERE filter and group_by field. Returns JSON: {field, results:[...]}.
Cheap way to answer "what's the average/total of field X" without an export.
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": {
"service_url": "<service_url>",
"field": "<field>"
},
"name": "query_statistics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | ||
| stats | No | sum,avg,min,max,count | |
| token | No | ||
| where | No | 1=1 | |
| group_by | No | ||
| service_url | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |