Skip to main content
Glama
jschuller

ServiceNow MCP Server

by jschuller

aggregate_records

Aggregate ServiceNow table records using COUNT, AVG, MIN, MAX, SUM, with optional GROUP BY, query filters, and having conditions.

Instructions

Aggregate records using COUNT, AVG, MIN, MAX, SUM with optional GROUP BY via the Stats API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoInclude record count in results
queryNoEncoded query string to filter records before aggregation
havingNoPost-aggregation filter (e.g., 'COUNT>5')
group_byNoComma-separated fields to group results by (e.g., 'priority,state')
avg_fieldsNoComma-separated fields to average (e.g., 'reassignment_count,reopen_count')
max_fieldsNoComma-separated fields to find maximum values
min_fieldsNoComma-separated fields to find minimum values
sum_fieldsNoComma-separated fields to sum
table_nameYesThe ServiceNow table name (e.g., 'incident', 'cmdb_ci')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden of behavioral disclosure. It only describes what operations are supported but does not mention read-only behavior, performance characteristics, API limitations, or how results are structured. Aggregation implies reading, but this is not explicitly stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, compact sentence that efficiently conveys the core functionality without any filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description and schema together cover the tool's purpose and all parameters. An output schema exists, so return format details are not required. However, the description lacks contextual information about the Stats API itself (e.g., rate limits, data structures) that might be useful for correct invocation, though this is not strictly necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are already documented in the schema. The description adds minimal value by summarizing the aggregation functions (COUNT, AVG, etc.) and mentioning GROUP BY, but it does not introduce new meaning beyond the schema's parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool aggregates records using COUNT, AVG, MIN, MAX, SUM with optional GROUP BY. This is a specific verb+resource and distinguishes it from sibling tools like list_records or get_record that retrieve raw records.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description does not mention that this should be used for aggregated data instead of raw record retrieval, nor does it reference sibling tools or exclusion conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jschuller/mcp-server-servicenow'

If you have feedback or need assistance with the MCP directory API, please join our Discord server