Aggregate By Column
analytics_aggregateAggregate data by grouping a table column and computing count, sum, average, min, or max without writing SQL. Column names are validated for safety.
Instructions
Group a table by a column and compute an aggregate — no SQL required.
A convenience workflow tool over the most common analytics pattern.
Column and table names are validated against the schema, so it is safe
from injection. For anything more complex, use analytics_run_query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agg | No | One of ``count``, ``sum``, ``avg``, ``min``, ``max`` (default count). | count |
| limit | No | Maximum groups to return (1-200). | |
| order | No | Sort groups by the aggregate value, ``desc`` (default) or ``asc``. | desc |
| table | Yes | Table to aggregate. | |
| metric | No | Numeric column to aggregate. Required for sum/avg/min/max. | |
| group_by | Yes | Column to group rows by. | |
| response_format | No | ``markdown`` (default) or ``json``. | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |