Table count distinct check

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

Check a claimed COUNT(DISTINCT) and optional distinct-value list over JSON rows; returns the first mismatch.

Use when you need to: verify count distinct claim · check number of unique values in a column · did the agent count distinct customers correctly.

Decide before calling

Read the versioned contract and the supported scope below. Reuse table-count-distinct-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-count-distinct-check@1.0.0 for verify count distinct claim. 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"
    },
    {
      "city": "San Francisco"
    },
    {
      "city": "Hayward"
    }
  ],
  "columns": [
    "city"
  ],
  "mode": "json",
  "null_policy": "include",
  "claimed_count": "2",
  "claimed_values": [
    [
      "Hayward"
    ],
    [
      "San Francisco"
    ]
  ],
  "value_order": "ascending"
}

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-count-distinct-check",
  "version": "1.0.0",
  "input": {
    "rows": [
      {
        "city": "San Francisco"
      },
      {
        "city": "San Francisco"
      },
      {
        "city": "Hayward"
      }
    ],
    "columns": [
      "city"
    ],
    "mode": "json",
    "null_policy": "include",
    "claimed_count": "2",
    "claimed_values": [
      [
        "Hayward"
      ],
      [
        "San Francisco"
      ]
    ],
    "value_order": "ascending"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/table-count-distinct-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"rows":[{"city":"San Francisco"},{"city":"San Francisco"},{"city":"Hayward"}],"columns":["city"],"mode":"json","null_policy":"include","claimed_count":"2","claimed_values":[["Hayward"],["San Francisco"]],"value_order":"ascending"}'

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

CLI

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

Get the client at /clients/cli/.