ServiceNow · Capability
ServiceNow Aggregate API — Aggregate Statistics
ServiceNow Aggregate API — Aggregate Statistics. 1 operations. Lead operation: Servicenow Retrieve Aggregate Statistics for a Table. Self-contained Naftiko capability covering one Servicenow business surface.
What You Can Do
GET
Getaggregatestats
— Servicenow Retrieve Aggregate Statistics for a Table
/v1/stats/{tablename}
MCP Tools
servicenow-retrieve-aggregate-statistics-table
Servicenow Retrieve Aggregate Statistics for a Table
read-only
idempotent
Capability Spec
naftiko: 1.0.0-alpha2
info:
label: ServiceNow Aggregate API — Aggregate Statistics
description: 'ServiceNow Aggregate API — Aggregate Statistics. 1 operations. Lead operation: Servicenow Retrieve Aggregate
Statistics for a Table. Self-contained Naftiko capability covering one Servicenow business surface.'
tags:
- Servicenow
- Aggregate Statistics
created: '2026-05-19'
modified: '2026-05-19'
binds:
- namespace: env
keys:
SERVICENOW_API_KEY: SERVICENOW_API_KEY
capability:
consumes:
- type: http
namespace: aggregate-aggregate-statistics
baseUri: https://{instance}.service-now.com/api/now
description: ServiceNow Aggregate API — Aggregate Statistics business capability. Self-contained, no shared references.
resources:
- name: stats-tableName
path: /stats/{tableName}
operations:
- name: getaggregatestats
method: GET
description: Servicenow Retrieve Aggregate Statistics for a Table
outputRawFormat: json
outputParameters:
- name: result
type: object
value: $.
inputParameters:
- name: sysparm_query
in: query
type: string
description: An encoded query string to filter records before aggregation. Uses the same syntax as the Table API
sysparm_query parameter.
- name: sysparm_count
in: query
type: boolean
description: When set to true, returns the count of records matching the query.
- name: sysparm_sum_fields
in: query
type: string
description: A comma-separated list of numeric fields for which to calculate the sum.
- name: sysparm_avg_fields
in: query
type: string
description: A comma-separated list of numeric fields for which to calculate the average.
- name: sysparm_min_fields
in: query
type: string
description: A comma-separated list of fields for which to find the minimum value.
- name: sysparm_max_fields
in: query
type: string
description: A comma-separated list of fields for which to find the maximum value.
- name: sysparm_group_by
in: query
type: string
description: A comma-separated list of fields by which to group the aggregated results. Each unique combination
of group-by field values produces a separate result entry.
- name: sysparm_order_by
in: query
type: string
description: The field by which to order the grouped results.
- name: sysparm_having
in: query
type: string
description: An additional filter applied after aggregation to restrict which groups are returned based on aggregate
values.
- name: sysparm_display_value
in: query
type: string
description: Controls whether display values or actual values are returned for group-by fields.
authentication:
type: bearer
token: '{{env.SERVICENOW_API_KEY}}'
exposes:
- type: rest
namespace: aggregate-aggregate-statistics-rest
port: 8080
description: REST adapter for ServiceNow Aggregate API — Aggregate Statistics. One Spectral-compliant resource per consumed
operation, prefixed with /v1.
resources:
- path: /v1/stats/{tablename}
name: stats-tablename
description: REST surface for stats-tableName.
operations:
- method: GET
name: getaggregatestats
description: Servicenow Retrieve Aggregate Statistics for a Table
call: aggregate-aggregate-statistics.getaggregatestats
with:
sysparm_query: rest.sysparm_query
sysparm_count: rest.sysparm_count
sysparm_sum_fields: rest.sysparm_sum_fields
sysparm_avg_fields: rest.sysparm_avg_fields
sysparm_min_fields: rest.sysparm_min_fields
sysparm_max_fields: rest.sysparm_max_fields
sysparm_group_by: rest.sysparm_group_by
sysparm_order_by: rest.sysparm_order_by
sysparm_having: rest.sysparm_having
sysparm_display_value: rest.sysparm_display_value
outputParameters:
- type: object
mapping: $.
- type: mcp
namespace: aggregate-aggregate-statistics-mcp
port: 9090
transport: http
description: MCP adapter for ServiceNow Aggregate API — Aggregate Statistics. One tool per consumed operation, routed
inline through this capability's consumes block.
tools:
- name: servicenow-retrieve-aggregate-statistics-table
description: Servicenow Retrieve Aggregate Statistics for a Table
hints:
readOnly: true
destructive: false
idempotent: true
call: aggregate-aggregate-statistics.getaggregatestats
with:
sysparm_query: tools.sysparm_query
sysparm_count: tools.sysparm_count
sysparm_sum_fields: tools.sysparm_sum_fields
sysparm_avg_fields: tools.sysparm_avg_fields
sysparm_min_fields: tools.sysparm_min_fields
sysparm_max_fields: tools.sysparm_max_fields
sysparm_group_by: tools.sysparm_group_by
sysparm_order_by: tools.sysparm_order_by
sysparm_having: tools.sysparm_having
sysparm_display_value: tools.sysparm_display_value
outputParameters:
- type: object
mapping: $.