Skip to main content
Glama

Aggregate Rows

notion_aggregate
Read-onlyIdempotent

Compute counts, sums, and averages grouped by any Notion property without loading every row. Filter, group, and get totals plus top groups for how-many or how-much questions.

Instructions

Answer "how many / how much by X" without reading every row into context. Filters with where/filter (same as notion_query), groups by any property (multi-select, people, and relations count a row in each of its groups; dates can be bucketed by day/week/month/quarter/year), and computes metrics: count, count_values, count_empty, distinct, sum, avg, min, max, median, checked, percent_checked (e.g. ["count", "sum:Points"]). Returns totals and the top groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
sortNo
whereNo
filterNo
metricsNoe.g. ["count", "sum:Points", "avg:Estimate"]
databaseYes
group_byNo
max_rowsNo
data_source_nameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already carry readOnly/idempotent/non-destructive, but the description adds real behavioral detail: multi-select/people/relation rows count once per group, and dates can be bucketed by day/week/month/quarter/year. It also discloses the shape of the return ('totals and the top groups'), which annotations cannot convey.

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

Conciseness4/5

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

Front-loaded with the agent's intent ('how many / how much by X'), then dense but purposeful clauses about filtering, grouping, and metrics. The parenthetical syntax examples earn their space; nothing reads as filler.

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?

For a 9-parameter tool with 11% schema coverage and no output schema, the description covers grouping and metrics well but omits the pagination/ordering controls (top, sort, max_rows) and data_source_name. An agent could still call it, but would be guessing on those knobs.

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 only 11%, so the description must compensate and it partially does: it explains where/filter semantics (same as notion_query), group_by including date bucketing, and gives a concrete metric syntax example ("sum:Points"). However top, sort, max_rows, and data_source_name are left entirely unexplained, so the compensation is incomplete.

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?

Names a specific verb+resource (aggregate row metrics over a Notion database) and frames it by the question it answers ('how many / how much by X'). This clearly separates it from notion_query, which pulls full rows into context.

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?

Explicitly states the use case (aggregate counts/sums instead of reading every row) and notes filters behave like notion_query, implying when to pick each. It stops short of a direct 'use notion_query when you need the actual rows' exclusion, so not quite a 5.

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