data_transform
Five deterministic data utilities behind one tool, chosen by operation. csv_normalize: sniffs the delimiter, strips the BOM and normalises line endings, snake_cases headers (duplicates renamed), pads or trims ragged rows, drops empty rows and optionally duplicate rows, and returns CSV or JSON rows (max 200,000 cells, 1,000 columns, 64 KB per cell). json_shape: infers a JSON Schema (draft 2020-12) from 1-1,000 samples, with required, enum and format only where every sample supports them (max depth 32, 200,000 nodes). json_extract: evaluates up to 50 paths from a safe JSONPath subset ($, .key, ['key'], [n], [-n], [], ., ..key); filters, scripts, slices and unions are rejected, and each path returns at most 10,000 matches. unit_convert: exact rational conversion within one dimension (length, mass, volume, temperature, time, data, speed, area, pressure, energy), rounded to 12 significant digits, single or up to 1,000 per batch. text_dedupe: exact, normalized (NFKC, casefold, whitespace and edge punctuation) or near-duplicate (3-word-shingle Jaccard) removal over up to 50,000 strings, 2 MB total (near mode 5,000). 2 MB request body. Caller content is never executed or evaluated and nothing is fetched. Deterministic, no LLM.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"operation": "<operation>"
},
"name": "data_transform"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | unit_convert (single): target unit, same dimension as from. | |
| csv | No | csv_normalize: the CSV text. Required for that operation. | |
| from | No | unit_convert (single): source unit, case-insensitive, canonical or alias. Canonical units: mm cm m km in ft yd mi nmi | mg g kg t oz lb st | ml l m3 tsp tbsp floz cup pt qt gal uk_gal uk_pt | C F K | ms s min h d wk | bit B KB MB GB TB KiB MiB GiB TiB | m/s km/h mph kn | m2 km2 ha acre ft2 in2 | Pa kPa bar psi atm | J kJ cal kcal Wh kWh. Aliases include full names, e.g. "kilometres", "fahrenheit", "pounds". | |
| json | No | json_shape: a single sample (an array here is ONE sample, not a list of samples). json_extract: the document to query (required). | |
| keep | No | text_dedupe: which occurrence of a duplicate group survives. | first |
| mode | No | text_dedupe: exact string match, normalized match (NFKC + casefold + collapsed whitespace + edge punctuation stripped), or near-duplicate by shingle similarity. | exact |
| trim | No | csv_normalize: strip whitespace around every cell. | |
| items | No | unit_convert (batch): up to 1,000 objects {value, from, to}; send items or value/from/to, not both. text_dedupe: up to 50,000 strings, 2 MB total (5,000 in near mode); required for that operation. | |
| paths | No | json_extract: 1-50 JSONPath expressions, e.g. "$.orders[*].id" or "$..email". Filters ?(...), scripts, slices [a:b] and unions [a,b] are rejected with a 400. | |
| value | No | unit_convert (single): the number, or a decimal string up to 100 chars for exact input, e.g. "1.005". Exponents beyond +/-1000 are rejected. | |
| header | No | csv_normalize: the first non-empty row is a header. When false, columns are named column_1, column_2, ... | |
| output | No | csv_normalize: return result.csv (comma-delimited text) or result.rows (one object per row). | csv |
| samples | No | json_shape: 1-1,000 sample documents. Send samples or json, not both. | |
| delimiter | No | csv_normalize: "auto" sniffs the first 64 KB; falls back to comma. | auto |
| operation | Yes | Which utility to run. Each reads only its own fields below. | |
| threshold | No | text_dedupe near mode: minimum Jaccard similarity of 3-word shingles to count as a duplicate. Validated in every mode. | |
| dedupe_rows | No | csv_normalize: drop rows identical to an earlier row. |