---
name: "rows_summarize"
area: "tables"
title: "Summarize rows"
price: "free"
method: "POST"
url: "https://api.conecto.chat/v1/tools/rows_summarize"
mcp_server: "https://api.conecto.chat/mcp/tables"
auth: "Authorization: Bearer <conecto_sk_ key>"
docs_url: "https://conecto.chat/tools/tables/rows_summarize"
---

# Summarize rows (`rows_summarize`)

Counts rows, and sums, averages, minimums and maximums of number columns, overall and per group, in one call.

Count rows, and sum, average, min and max number columns (min and max of dates), for the rows matching filters, overall and per value of group_by: one call instead of paging through every row. Filters work as in rows_query.

Price: Free up to 1,000,000 reads a month for the whole account, then $0.50 per 10,000 reads. A call that fails costs nothing.

## Use it when

Someone asks for totals: how much is on order, how many per status, the latest date.

- For the rows themselves, use [rows_query](https://conecto.chat/tools/tables/rows_query.md).

## Say this to your agent

> How much work is in the workshop, per status?

## Inputs

| Name | Type | Required | Description | Allowed values | Default |
|---|---|---|---|---|---|
| `table` | string | yes | The table's name (or its table_id). 1 to 80 characters. |  |  |
| `columns` | array of strings | no | Number or date columns to measure. Up to 10 items. |  |  |
| `group_by` | string | no | A column to group the rows by. Up to 60 characters. |  |  |
| `filters` | array of objects | no | Up to 20 items. |  |  |
| `filters[].column` | string | yes, in each item of `filters` | Up to 60 characters. |  |  |
| `filters[].op` | string | no |  | `"eq"`, `"neq"`, `"contains"`, `"not_contains"`, `"gt"`, `"gte"`, `"lt"`, `"lte"`, `"empty"`, `"not_empty"`, `"in"` |  |
| `filters[].value` | any | no |  |  |  |
| `match` | string | no |  | `"all"`, `"any"` | `"all"` |

## Example

Written for Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon.

MCP: call `rows_summarize` on the MCP server `https://api.conecto.chat/mcp/tables` with these arguments:

```json
{
  "table": "Workshop jobs",
  "columns": [
    "Price",
    "Due"
  ],
  "group_by": "Status"
}
```

REST:

```bash
curl https://api.conecto.chat/v1/tools/rows_summarize \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"table": "Workshop jobs", "columns": ["Price", "Due"], "group_by": "Status"}'
```

## Response

```json
{
  "call_id": "5f0c8a2e-3b7d-4c1e-9a64-2d8e1f7b0c93",
  "tool": "rows_summarize",
  "status": "succeeded",
  "replayed": false,
  "cost_usd": "$0.00",
  "balance_usd": "$19.75",
  "result": {
    "table": "Workshop jobs",
    "all": {
      "count": 3,
      "Price": {
        "sum": 10000.0,
        "avg": 3333.333333,
        "min": 180.0,
        "max": 9400.0
      },
      "Due": {
        "min": "2026-09-30",
        "max": "2026-12-01"
      }
    },
    "group_by": "Status",
    "groups": [
      {
        "value": "On the stand",
        "count": 1,
        "Price": {
          "sum": 180.0,
          "avg": 180.0,
          "min": 180.0,
          "max": 180.0
        },
        "Due": {
          "min": "2026-10-22",
          "max": "2026-10-22"
        }
      },
      {
        "value": "Picked up",
        "count": 1,
        "Price": {
          "sum": 420.0,
          "avg": 420.0,
          "min": 420.0,
          "max": 420.0
        },
        "Due": {
          "min": "2026-09-30",
          "max": "2026-09-30"
        }
      }
    ]
  }
}
```

`result`: all: the count and each measured column's sum, avg, min and max (min and max for dates); groups: the same per value of group_by, most rows first.

## Errors

| Code | Status | When | Fix |
|---|---|---|---|
| `not_found` | 404 | No table has that name or table_id, or the table has no column of that name. | Call tables_list for the tables and their columns. |
| `invalid_input` | 400 | A filter's op is unknown, compares with the wrong kind of value, or uses gt, gte, lt or lte on a column that is not a number or a date. | Use the ops this page lists, with values of the column's type. |
| `invalid_input` | 400 | A measured column is not a number or date column. | Measure number or date columns; count the others with group_by. |

The refusals every tool can give (401 key, 402 balance, 429 limits) are on the errors page: https://conecto.chat/docs/errors.md

## Related

- [tables_create](https://conecto.chat/tools/tables/tables_create.md): Creates a table with typed columns: text, numbers with decimals or a currency, checkboxes, dates, choices, emails, links, phone numbers or files. $0.001 a call.
- [tables_list](https://conecto.chat/tools/tables/tables_list.md): Every table with its columns and how many rows it has. Free up to 1,000,000 reads a month.
- [tables_change_columns](https://conecto.chat/tools/tables/tables_change_columns.md): Adds, renames or removes columns; rows keep their values through a rename. $0.001 a call.
- [rows_add](https://conecto.chat/tools/tables/rows_add.md): Adds up to 500 rows, each checked against its columns; if one is wrong, none is added. $0.001 per row added.
- [rows_update](https://conecto.chat/tools/tables/rows_update.md): Changes values in up to 500 rows by row number; only the columns given change, and null clears a cell. $0.001 per row changed.
- [rows_upsert](https://conecto.chat/tools/tables/rows_upsert.md): Updates the rows whose key column matches and adds the rest, so a list from anywhere syncs without reading the table first. $0.001 per row added or updated.
- [rows_query](https://conecto.chat/tools/tables/rows_query.md): Rows matching filters, all or any of them, sorted by up to 3 columns, a page at a time. Free up to 1,000,000 reads a month.
- [rows_delete](https://conecto.chat/tools/tables/rows_delete.md): Deletes rows by their numbers, for good. Free.
- [tables_export](https://conecto.chat/tools/tables/tables_export.md): A CSV of a table, or of the rows matching filters, saved in the file store with a download link. $0.001 a call.
- [tables_import](https://conecto.chat/tools/tables/tables_import.md): Adds the rows of a CSV in the file store to a table, or makes a new table from it. $0.001 per row imported.
- [tables_delete](https://conecto.chat/tools/tables/tables_delete.md): Deletes a table and all its rows, for good. Free.
