Table aggregate check

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

Check claimed COUNT/SUM/AVG/MIN/MAX results over JSON rows exactly (SQL nulls); returns the first mismatch.

Use when you need to: check claimed sum of a table column · verify count and total over json rows · check average min max claims against table data.

Decide before calling

Read the versioned contract and the supported scope below. Reuse table-aggregate-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-aggregate-check@1.0.0 for check claimed sum of a table column. 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
    }
  ],
  "claims": [
    {
      "function": "max",
      "column": "temp_lo",
      "value": "46"
    },
    {
      "function": "count_star",
      "value": "3"
    }
  ]
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "first_discrepancy": null,
    "claims_checked": 2,
    "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-aggregate-check",
  "version": "1.0.0",
  "input": {
    "rows": [
      {
        "city": "San Francisco",
        "temp_lo": 46
      },
      {
        "city": "San Francisco",
        "temp_lo": 43
      },
      {
        "city": "Hayward",
        "temp_lo": 37
      }
    ],
    "claims": [
      {
        "function": "max",
        "column": "temp_lo",
        "value": "46"
      },
      {
        "function": "count_star",
        "value": "3"
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/table-aggregate-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}],"claims":[{"function":"max","column":"temp_lo","value":"46"},{"function":"count_star","value":"3"}]}'

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

CLI

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

Get the client at /clients/cli/.