CSV distinct values
csv-distinct-values · version 1.0.0 · CSV & tables · free, no key needed
List distinct exact values of one CSV column in first-seen order.
Use when you need to: csv distinct values · unique csv column values · distinct column.
Decide before calling
Read the versioned contract and the supported scope below. Reuse csv-distinct-values@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 csv-distinct-values@1.0.0 for csv distinct values. 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
- csv distinct values
- unique csv column values
- distinct column
Not supported
- sort
- case fold
- trim
- numeric unique
Behavior
- The first CSV record is the header row.
- Duplicate and empty header names are rejected.
- column is an exact header name.
- values lists first-seen exact cell strings from that column, including empty string if present.
- No trimming, case folding, type coercion, or other normalization is performed.
- A header-only or empty-data document yields values [].
- An empty document with a column request is invalid.
Input
csv(string, required): max length 256000column(string, required): min length 1; max length 256
Output
values(array of string, required)rows_in(integer, required)distinct(integer, required)
Limits
- max input bytes: 256000
- max data rows: 5000
- max columns: 256
- max header name bytes: 256
Example
Request input:
{
"csv": "k\na\nb\na\n",
"column": "k"
}
Response:
{
"result": {
"values": [
"a",
"b"
],
"rows_in": 3,
"distinct": 2
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "csv-distinct-values",
"version": "1.0.0",
"input": {
"csv": "k\na\nb\na\n",
"column": "k"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/csv-distinct-values/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"csv":"k\na\nb\na\n","column":"k"}'
The machine-readable contract is at /v1/tools/csv-distinct-values/versions/1.0.0.
CLI
node cli.mjs run csv-distinct-values 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Table count distinct check: Check a claimed COUNT(DISTINCT) and optional distinct-value list over JSON rows; returns the first mismatch.
- CSV abs integer column: Replace every data cell in a named CSV column with the absolute value of a canonical integer.
- CSV clamp integer column: Clamp every data cell in a named CSV column to optional canonical integer min and max bounds.
- CSV filter compare: Filter ASCII CSV rows by string/decimal comparison; requires CRLF records, rejects LF-only and non-ASCII input.
- CSV filter equals: Keep CSV data rows whose named column equals an exact string.
- CSV filter pattern literal: Filter ASCII CSV with literal contains/starts-with; requires CRLF records, rejects LF-only and non-ASCII input.