clean
Fix messy spreadsheet data without code: trim spaces, correct case, replace values, split/merge columns, fill blanks, convert text to numbers/dates, and remove duplicates. Preview before saving.
Instructions
Fix messy data without writing code: trim spaces, fix case, find/replace, split/merge columns, fill down blanks (merged-cell exports), numbers stored as text, mixed date formats, empty rows and duplicates. Previews by default; pass output to save.
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": {
"source": "<source>",
"operations": "<operations>"
},
"name": "clean"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max rows to return (default from server config, usually 100). | |
| sheet | No | Sheet name (or 0-based index). Default: first sheet. | |
| format | No | json = rows as arrays, records = list of objects, markdown = a table. | json |
| output | No | Save the cleaned table here. The SAME xlsx file cleans the sheet in place (styles, tables and other sheets kept; backup made). Omit to preview. | |
| source | Yes | Data file; for a specific sheet use 'book.xlsx#Sheet1' or the sheet parameter. | |
| operations | Yes | Steps applied in order. Each is {'op': ..., options}. Ops: trim {columns?, collapse_spaces?} | case {mode: upper|lower|title, columns?} | replace {find, replace, columns?, regex?, whole_cell?} | split {column, sep, into: [names]} | merge {columns, into, sep} | fill_down {columns} | fill_null {columns, value} | to_number {columns, decimal?: '.'|','} | to_date {columns, format?, dayfirst?} | drop_empty_rows | dedupe {columns?, keep?: first|last} | drop_columns {columns} | keep_columns {columns} | rename {mapping} | filter {where} | sort {order_by} | add_column {name, expr}. Text ops default to all text columns. | |
| output_sheet | No | When output is an existing .xlsx: write into this sheet (replaced if it exists), keeping other sheets. |