clean_table
Clean and type tabular data from CSV, TSV, JSON, or XLSX, then report every change and flagged unconverted value so ambiguous inputs are handled transparently.
Instructions
Return a clean, typed copy of a table, with a report of every change and every value left unconverted.
Text: NUL/control/zero-width characters removed, mojibake repaired (Café -> Café), Unicode NFC, spaces
collapsed and trimmed. Numbers: plain decimals (1.250,50 € -> 1250.50; (45) -> -45; 1.250,50- -> -1250.50).
Dates: ISO 8601. Booleans: true/false. Emails: domain lowercased. Phones: E.164. IBAN: compact uppercase.
Values that do not fit the column type are kept as they were (on_invalid='null' empties them) and listed
in flags with their source row.
Args:
output_format: csv (default) | tsv | json | jsonl | xlsx (typed cells; returned only as content_base64).
header_style: keep | snake (Fecha de alta -> fecha_de_alta). columns: keep only these columns, in order.
dedupe: none | exact | ignore_case, over all columns or dedupe_keys; the first occurrence is kept.
drop_empty_columns: remove columns with no values. output_delimiter: for csv output.
formula_guard: prefix text cells starting with = + - @ with ' in CSV so spreadsheets do not run them.
Input (exactly one): content (CSV/TSV/JSON text), content_base64 (file bytes: .xlsx, or CSV in any encoding),
rows (JSON list of objects or of lists). delimiter: auto-detected (, ; tab |). sheet: Excel sheet name (default
the first). has_header: false when the first row is data. header_row: 1-based row of the header (default auto,
skipping title rows above it).
Parsing: number_locale 'eu' (1.234,56) or 'us' (1,234.56) settles values like 1,250 (auto from the column
otherwise). date_order 'dmy' or 'mdy' settles dates like 03/04/2026 (auto from the column otherwise).
phone_country (ISO-2, e.g. ES, US, GB) converts national phone numbers to E.164. null_values: extra strings
read as empty (NULL, N/A, -, #N/A and similar are already). types: force a type per column, e.g.
{"zip": "text", "amount": "decimal"}; types are text, integer, decimal, boolean, date, datetime, email, url,
phone, iban.Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "clean_table"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| sheet | No | ||
| types | No | ||
| dedupe | No | none | |
| columns | No | ||
| content | No | ||
| delimiter | No | ||
| date_order | No | ||
| has_header | No | ||
| header_row | No | ||
| on_invalid | No | keep | |
| dedupe_keys | No | ||
| null_values | No | ||
| fix_mojibake | No | ||
| header_style | No | keep | |
| formula_guard | No | ||
| number_locale | No | ||
| output_format | No | csv | |
| phone_country | No | ||
| content_base64 | No | ||
| output_delimiter | No | , | |
| drop_empty_columns | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||