Table groupby check

table-groupby-check · version 1.0.0 · CSV & tables · free, no key needed

Check claimed GROUP BY rows (group keys and aggregate values) over JSON rows; returns the first wrong group or value.

Use when you need to: verify group by result rows · check per group totals claimed by an agent · validate pivot summary counts per category.

Decide before calling

Read the versioned contract and the supported scope below. Reuse table-groupby-check@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use table-groupby-check@1.0.0 for verify group by result rows. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "rows": [
    {
      "city": "San Francisco",
      "temp_lo": 46
    },
    {
      "city": "San Francisco",
      "temp_lo": 43
    },
    {
      "city": "Hayward",
      "temp_lo": 37
    }
  ],
  "group_by": [
    "city"
  ],
  "aggregates": [
    {
      "function": "count_star"
    },
    {
      "function": "max",
      "column": "temp_lo"
    }
  ],
  "row_order": "key_ascending",
  "claimed_rows": [
    {
      "key": [
        "Hayward"
      ],
      "values": [
        "1",
        "37"
      ]
    },
    {
      "key": [
        "San Francisco"
      ],
      "values": [
        "2",
        "46"
      ]
    }
  ]
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "first_discrepancy": null,
    "reference_version": "ISO/IEC 9075-2:2023 (SQL:2023) set functions and grouping, r58 JSON-rows profile 1.0.0"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "table-groupby-check",
  "version": "1.0.0",
  "input": {
    "rows": [
      {
        "city": "San Francisco",
        "temp_lo": 46
      },
      {
        "city": "San Francisco",
        "temp_lo": 43
      },
      {
        "city": "Hayward",
        "temp_lo": 37
      }
    ],
    "group_by": [
      "city"
    ],
    "aggregates": [
      {
        "function": "count_star"
      },
      {
        "function": "max",
        "column": "temp_lo"
      }
    ],
    "row_order": "key_ascending",
    "claimed_rows": [
      {
        "key": [
          "Hayward"
        ],
        "values": [
          "1",
          "37"
        ]
      },
      {
        "key": [
          "San Francisco"
        ],
        "values": [
          "2",
          "46"
        ]
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/table-groupby-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"rows":[{"city":"San Francisco","temp_lo":46},{"city":"San Francisco","temp_lo":43},{"city":"Hayward","temp_lo":37}],"group_by":["city"],"aggregates":[{"function":"count_star"},{"function":"max","column":"temp_lo"}],"row_order":"key_ascending","claimed_rows":[{"key":["Hayward"],"values":["1","37"]},{"key":["San Francisco"],"values":["2","46"]}]}'

The machine-readable contract is at /v1/tools/table-groupby-check/versions/1.0.0.

CLI

node cli.mjs run table-groupby-check 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.