Skip to main content
Glama
jschuller

ServiceNow MCP Server

by jschuller

Aggregate Records

aggregate_records

Compute COUNT, AVG, MIN, MAX, SUM from ServiceNow table records, with optional GROUP BY for grouped statistics.

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?

With no annotations, the description carries full burden for behavioral disclosure. It does not state that this is a read-only operation, nor does it disclose any side effects, authentication requirements, or rate limits. Mentioning 'Stats API' is vague and does not clarify behavior.

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, front-loaded sentence that efficiently conveys the core capability without fluff. Every word contributes to understanding the tool's function.

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

Completeness3/5

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

With an output schema present, return values are covered, but the tool has 9 parameters and is complex. The description lacks usage examples, caveats, or additional behavioral context. It is minimally adequate but leaves room for a more complete picture.

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 the input schema already documents all parameters with examples. The description adds no extra semantic meaning beyond listing function names that map to existing parameter descriptions, so baseline 3 applies.

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 specific operations (COUNT, AVG, MIN, MAX, SUM) with optional GROUP BY, distinct from sibling CRUD tools. The verb 'aggregate' and listed operations precisely define its purpose.

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

Usage Guidelines3/5

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

The description implies usage for aggregate statistical queries but does not explicitly state when to use it over list_records or get_record, nor does it mention exclusions. It relies on the reader to infer the use case from the word 'aggregate' and the API reference.

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