Tables

Summarize rows

rows_summarize · Reads only · Markdown

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

Free*

*Free up to 1,000,000 reads a month for the whole account, then $0.50 per 10,000 reads.

An example

How much work is in the workshop, per status?

Your agent callsrows_summarizeFree*

The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.

With these arguments
{
  "table": "Workshop jobs",
  "columns": [
    "Price",
    "Due"
  ],
  "group_by": "Status"
}
What comes back
{
  "table": "Workshop jobs",
  "all": {
    "count": 3,
    "Price": {
      "sum": 10000,
      "avg": 3333.333333,
      "min": 180,
      "max": 9400
    },
    "Due": {
      "min": "2026-09-30",
      "max": "2026-12-01"
    }
  },
  "group_by": "Status",
  "groups": [
    {
      "value": "On the stand",
      "count": 1,
      "Price": {
        "sum": 180,
        "avg": 180,
        "min": 180,
        "max": 180
      },
      "Due": {
        "min": "2026-10-22",
        "max": "2026-10-22"
      }
    },
    {
      "value": "Picked up",
      "count": 1,
      "Price": {
        "sum": 420,
        "avg": 420,
        "min": 420,
        "max": 420
      },
      "Due": {
        "min": "2026-09-30",
        "max": "2026-09-30"
      }
    }
  ]
}

Use it when

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

What it does

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.

What comes back

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. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
tableRequiredstringThe table's name (or its table_id). 1 to 80 characters.
columnsarray of stringsNumber or date columns to measure. Up to 10 items.
group_bystringA column to group the rows by. Up to 60 characters.
filtersarray of objectsUp to 20 items.
filters[].columnRequiredstringUp to 60 characters.
filters[].opstringOne of: eq,neq,contains,not_contains,gt,gte,lt,lte,empty,not_empty,in.
filters[].valueany
matchstringOne of: all,any. Default: all.

The call

Over MCP, call rows_summarize on https://api.conecto.chat/mcp/tables. Over REST:

Terminal
curl -X POST 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"}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
not_found404No 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_input400A 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_input400A measured column is not a number or date column.Measure number or date columns; count the others with group_by.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md