Skip to main content
Glama

Aggregate

aggregate
Read-only

Count, total, average, min or max over a table, optionally grouped by up to 2 fields, computed in the database. Use this instead of reading all records to answer how many / how much questions. Multi-value fields (multiple select, links, users) count a record once per value. Dates group by day unless bucket is week, month or year.

Input Schema

NameRequiredDescriptionDefault
viewNo
tableYesTable name or id
baseIdYes
filterNoStructured filter, evaluated as SQL in the database (fast)
groupByNo
metricsYes
timezoneNoIANA time zone, such as Asia/Shanghai, for the day buckets of values with a time; UTC by default

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds real behavioral context: computation happens in the database, multi-value fields count a record once per value, and date grouping defaults to day with week/month/year bucketing.

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?

Four dense sentences, front-loaded with what it does and why to use it, then edge-case semantics. No redundant 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?

No output schema exists, yet the description never describes the result shape (metric keys, grouped row structure) or how filter interacts with the aggregation. For a 7-parameter nested tool, it covers the core but leaves notable gaps.

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 coverage is only 43%, so the schema alone does not fully document parameters. The description clarifies groupBy cardinality, bucket options, and date semantics, but says nothing about as, filter, view, or timezone, leaving several parameters reliant on sparse schema text.

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?

States a specific verb set (count, total, average, min, max) and resource (table), plus scope details: grouped by up to 2 fields, computed in the database. This clearly separates it from record-reading siblings like get_records/query_records.

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 says to use this instead of reading all records when answering how many / how much questions, which names the alternative approach. It does not spell out when-not conditions (e.g. when raw rows are actually needed), but the routing guidance is strong.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.