Skip to main content
Glama

aggregate_report

Read-only

Generate a grouped summary of ServiceNow records with counts plus averages, sums, mins, and maxes of numeric fields—including average resolution time for tasks—in a single query without truncation.

Instructions

Server-side aggregate REPORT grouped by a field, in ONE query with no 1000-row truncation. Returns per-group record count PLUS averages/sums/mins/maxes of numeric or duration fields — the right tool for a periodic summary like "incident volume by category with average resolution time". Do NOT list raw records for this; use this. For task tables (incident, problem, change_request, cases, etc.) it INCLUDES average resolution time automatically even if avg_fields is omitted. Duration fields come back pre-formatted (e.g. "21 14:03:10"). Returns a stats table (markdown), the rows, a count chart Adaptive Card, and a summary. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoKeep the top N groups by count (default 25)
queryNoEncoded query filter, e.g. resolved in the last 7 days: "stateIN6,7^resolved_atRELATIVEGT@dayofweek@ago@7"
tableYesTable to aggregate, e.g. "incident"
titleNoOptional report title
group_byYesField to group by, e.g. "category", "assignment_group", "priority"
avg_fieldsNoFields to average per group, e.g. ["business_duration"] or ["calendar_duration"] for resolution time. Comma string also accepted.
max_fieldsNoFields to take the maximum of per group
min_fieldsNoFields to take the minimum of per group
sum_fieldsNoFields to sum per group

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.9.0

TDQS

A4.7/5.0
Behavior5/5

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

The description discloses significant behavior beyond the readOnlyHint and openWorldHint annotations: no 1000-row truncation, automatic average resolution time for task tables, pre-formatted duration fields, and a detailed return structure. This gives the agent a strong sense of what to expect.

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?

Every sentence earns its place: purpose, key differentiator, usage example, special behavior, output format, and read-only status. It is dense but not verbose, and the most important information is front-loaded.

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

Completeness5/5

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

For a tool with 9 parameters and no output schema, the description explains the return components (stats table, rows, chart, summary) and critical edge cases. It covers the main use case, performance characteristics, and automatic behaviors, making it complete for agent selection and invocation.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds valuable semantic context for avg_fields/sum_fields (e.g., task tables auto-include average resolution time, duration fields come pre-formatted), which helps the agent use these parameters effectively without repeating schema info.

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 defines the tool as a server-side aggregate report that groups by a field and returns per-group counts plus aggregates in a single query. It explicitly distinguishes from raw record listing ('Do NOT list raw records for this') and uses a specific verb+resource structure.

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

Usage Guidelines4/5

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

It provides clear guidance on when to use this tool ('the right tool for a periodic summary') and explicitly warns against using it for raw records. However, it does not name specific alternative tools, so it lacks the 'alternatives' component for a 5.

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

Deploy Server

Other Tools