Row multiplication, unmatched keys and uniqueness violations before a table join
Takes the join keys of two tables (every row's key, or distinct keys with row counts) and computes the exact output row count of an inner, left, right or full equi-join with SQL NULL semantics, the observed cardinality (one-to-one, one-to-many, many-to-one, many-to-many), the keys that multiply rows the most, unmatched keys on each side and the first duplicate row when a side was assumed unique. It also flags keys that match only after loose coercion (7 vs "7", "007" vs 7, trailing spaces, case), which silently join nothing in a typed engine. For agents about to merge, enrich or deduplicate tables. It sees only the keys you send: it does not read data, and it cannot know whether a composite key is complete.
What you get
Catches fan-out, silent row loss and key-type mismatches before the join runs. 20,000 keys per side per $0.005 call.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/join-cardinality. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/join-cardinality \
-H 'content-type: application/json' \
-d '{"left":{"keys":[1,2,3,3,null,"007"]},"right":{"keys":[1,3,3,4,"7"," 1"]},"joinType":"left","expect":{"rightUnique":true,"noRowMultiplication":true}}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
left | object | yes | |
right | object | yes | |
joinType | string; one of "inner", "left", "right", "full" | yes | |
expect | object | no | |
normalize | object | no | Normalization your pipeline applies to string keys before joining. |
Example request body
{
"left": {
"keys": [
1,
2,
3,
3,
null,
"007"
]
},
"right": {
"keys": [
1,
3,
3,
4,
"7",
" 1"
]
},
"joinType": "left",
"expect": {
"rightUnique": true,
"noRowMultiplication": true
}
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
left | object | no | |
right | object | no | |
observedCardinality | string; one of "one-to-one", "one-to-many", "many-to-one", "many-to-many" | no | |
outputRows | object | no | |
multiplicationFactor | one of | no | |
unmatched | object | no | |
fanOut | array<object> | no | |
coercionHazards | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the data-contract-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent