Table key multiplicity check

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

Check claimed per-key row counts and join contributions for an equi-join and report the first wrong key.

Use when you need to: verify per-key duplicate counts across two tables · check which join key causes the row explosion · validate key multiplicities claimed for a join.

Decide before calling

Read the versioned contract and the supported scope below. Reuse table-key-multiplicity-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-key-multiplicity-check@1.0.0 for verify per-key duplicate counts across two tables. 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:

{
  "left": [
    {
      "num": 1
    },
    {
      "num": 2
    },
    {
      "num": 3
    }
  ],
  "right": [
    {
      "num": 1
    },
    {
      "num": 3
    },
    {
      "num": 5
    }
  ],
  "left_keys": [
    "num"
  ],
  "right_keys": [
    "num"
  ],
  "join_type": "left",
  "claims": [
    {
      "key": [
        1
      ],
      "left_count": "1",
      "right_count": "1",
      "joined_rows": "1"
    },
    {
      "key": [
        2
      ],
      "left_count": "1",
      "right_count": "0",
      "joined_rows": "1"
    },
    {
      "key": [
        3
      ],
      "left_count": "1",
      "right_count": "1",
      "joined_rows": "1"
    },
    {
      "key": [
        5
      ],
      "left_count": "0",
      "right_count": "1",
      "joined_rows": "0"
    }
  ],
  "null_key_rows": {
    "left": "0",
    "right": "0"
  }
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "first_discrepancy": null,
    "distinct_keys": "4",
    "reference_version": "r59-key-multiplicity-1.0.0 (ISO/IEC 9075-2:2023 joined table and null comparison semantics; JSON-row profile 1)"
  }
}

How to call it

MCP

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

{
  "id": "table-key-multiplicity-check",
  "version": "1.0.0",
  "input": {
    "left": [
      {
        "num": 1
      },
      {
        "num": 2
      },
      {
        "num": 3
      }
    ],
    "right": [
      {
        "num": 1
      },
      {
        "num": 3
      },
      {
        "num": 5
      }
    ],
    "left_keys": [
      "num"
    ],
    "right_keys": [
      "num"
    ],
    "join_type": "left",
    "claims": [
      {
        "key": [
          1
        ],
        "left_count": "1",
        "right_count": "1",
        "joined_rows": "1"
      },
      {
        "key": [
          2
        ],
        "left_count": "1",
        "right_count": "0",
        "joined_rows": "1"
      },
      {
        "key": [
          3
        ],
        "left_count": "1",
        "right_count": "1",
        "joined_rows": "1"
      },
      {
        "key": [
          5
        ],
        "left_count": "0",
        "right_count": "1",
        "joined_rows": "0"
      }
    ],
    "null_key_rows": {
      "left": "0",
      "right": "0"
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/table-key-multiplicity-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"left":[{"num":1},{"num":2},{"num":3}],"right":[{"num":1},{"num":3},{"num":5}],"left_keys":["num"],"right_keys":["num"],"join_type":"left","claims":[{"key":[1],"left_count":"1","right_count":"1","joined_rows":"1"},{"key":[2],"left_count":"1","right_count":"0","joined_rows":"1"},{"key":[3],"left_count":"1","right_count":"1","joined_rows":"1"},{"key":[5],"left_count":"0","right_count":"1","joined_rows":"0"}],"null_key_rows":{"left":"0","right":"0"}}'

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

CLI

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

Get the client at /clients/cli/.