Skip to main content
Glama

Dataset Cleaner & Exporter

clean_rows

Deduplicates, flattens and cleans a list of JSON rows in one call and returns spreadsheet-ready rows (or CSV text) plus a summary with exact counts: rows in, rows added by expansion, duplicates removed, rows dropped by maxItems, rows out, the final column list, per-column fill rates and warnings. Steps, in order: optionally explode one array field into one row per entry; flatten nested objects into columns (address.city becomes address_city); trim text; lowercase valid emails; reduce phone numbers to digits with any leading +; lowercase URL hosts and drop the trailing slash; optionally strip HTML and turn numeric or true/false text into numbers and booleans; blank text becomes null; keep, remove or rename columns; then remove duplicates (normalized by default, comparing the whole row unless dedupKeys is set) keeping the most complete row. Deterministic, no AI, nothing guessed. Use it on scraped leads, CRM exports or API results before loading them anywhere. There is a row limit per call (see list_capabilities); split bigger lists across several calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYesThe rows to clean. Each row is a JSON object; keys may differ between rows and values may be nested.
flattenNoDefault true. Turn nested objects into flat columns. Arrays become one JSON-text cell.
maxItemsNoOptional cap: read at most this many rows and return at most this many. 0 (default) means no cap.
dedupKeysNoFields that identify a duplicate, for example ["Email"]. Empty compares the whole row. Use the final column names: flattened (Details_founded) and renamed. Exact and case-sensitive. Rows where every key is empty count as duplicates of each other.
dedupModeNoHow duplicates are found. normalized (default) ignores case and whitespace; exact needs identical values; fuzzy also merges near-duplicates (up to 100 rows and 1000 characters of key text, so name a short field in dedupKeys); none keeps every row.
stripHtmlNoDefault false. Remove HTML tags and decode common entities in text.
cleanFieldsNoDefault true. Normalize emails, phone numbers and URLs, detected by field name or value shape.
coerceTypesNoDefault false. Turn "42" into 42 and "true" into true. Leading-zero values like "007" stay text.
emptyToNullNoDefault true. Blank text becomes null.
keepStrategyNoWhich duplicate survives: most_complete (default, fewest empty fields), first or last.
outputFormatNojson (default) returns rows; csv returns the same result as CSV text in "csv" instead.
columnsToKeepNoKeep only these columns (flattened names). Takes priority over columnsToRemove.
columnRenameMapNoRename columns after keep/remove, as ["oldName:newName"] or {"oldName":"newName"}, for example {"Details_founded":"founded"}.
columnsToRemoveNoDrop these columns (flattened names). Ignored if columnsToKeep is set.
dropEmptyFieldsNoDefault false. Remove null and empty fields from each row.
expandArrayFieldNoOptional. One top-level array field (for example "offers") to explode into one row per entry, repeating the other fields. Object entries become columns. The expanded total must stay within the row limit.
flattenSeparatorNoJoins nested key paths when flattening. Default "_".
similarityThresholdNoFuzzy mode only. 0.5 to 0.99, default 0.9. Higher is stricter.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral burden and does so: it discloses the exact ordered pipeline (explode, flatten, trim, lower emails, phone normalization, URL host/slash handling, type coercion, empty-to-null, column ops, dedup), the default dedup normalization and 'most complete row' survival rule, determinism, and the per-call row limit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and return shape are front-loaded, followed by the pipeline then usage notes, so an agent can stop reading early. It is dense rather than padded, though the long middle sentence enumerating every transform is heavier than strictly necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 18-parameter, annotation-free tool with no output schema, the description covers the gaps: it describes the returned summary fields and counts, the warning behavior, determinism, and the size constraint. Nothing required to invoke it correctly is obviously missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3, but the description adds real semantics beyond the schema: the order in which steps run, that dedup compares the whole row unless dedupKeys is set and that key names must be final flattened/renamed names, and how blank-vs-null and type coercion interact.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific set of verbs and resource ('Deduplicates, flattens and cleans a list of JSON rows') and states the return shape (spreadsheet-ready rows/CSV plus a summary). This is unmistakably distinct from the only sibling, list_capabilities, without needing to open either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete usage context ('scraped leads, CRM exports or API results before loading them anywhere') and points at list_capabilities for the row limit, plus the workaround of splitting large lists across calls. It lacks an explicit 'when not to use' or an alternative-tool comparison, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.