Convert messy tabular text into clean, typed JSON rows. Auto-detects CSV, TSV, or a Markdown table and returns one JSON object per row plus an inferred column/type summary. Pure deterministic compute — no network or model calls.
What it handles: delimiter sniffing (comma/semicolon/tab/pipe), quoted fields with embedded commas and newlines, BOM, ragged rows (padded/truncated), Markdown separator rows and escaped pipes, header auto-detection, and per-column type inference (integer/number/boolean/null/string).
When to use: you have CSV/TSV/Markdown-table text (often emitted by tools or LLMs) and want structured, typed rows — optionally validated/coerced against a JSON Schema.
When NOT to use: the data is already clean JSON, or it is HTML/xlsx/binary (not supported).
Args:
- input (string, required): raw tabular text.
- format ("auto"|"csv"|"tsv"|"markdown", default "auto"): force a format or auto-detect.
- hasHeader ("auto"|"true"|"false", default "auto"): whether the first row is a header.
- inferTypes (boolean, default true): coerce cells to number/integer/boolean/null; else keep strings.
- schema (object, optional): JSON Schema (draft 2020-12) to validate/coerce each row object against.
Returns structuredContent:
{
"ok": boolean, // false if the input cannot be parsed as a table
"format": "csv"|"tsv"|"markdown",
"columns": [{ "name": string, "type": string }],
"rows": [{ ... }], // one object per row, keyed by column name
"rowCount": number,
"changed": boolean, // true if any normalization/coercion happened
"errors": string[], // actionable messages when ok is false
"repairs": string[] // description of each normalization applied
}