{"uid":"cap_EUsOaMcJh_sKxTJxU-fL9","slug":"wealth-agent-data-clean-e577b9ae","name":"Wealth Agent Data Clean","description":"Cleans a CSV/TSV/JSON table: removes duplicate and empty rows, trims whitespace, and returns the cleaned CSV with before/after quality checks and per-column stats. Call it before analysing or importing messy tabular data. Input: {\"data\": \"<csv text>\"}.","url":"https://wealth-agent.wealthagent-app.workers.dev/api/x402/data-clean?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["data"],"properties":{"data":{"type":"string","description":"Table as CSV / TSV text or a JSON array of objects (max 60,000 chars)"},"format":{"enum":["csv","tsv","json"],"type":"string","description":"Optional input format; auto-detected when omitted"}}}}},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","resource","status","deliverable"],"properties":{"ok":{"type":"boolean"},"tx":{"type":["string","null"]},"note":{"type":"string"},"error":{"type":["string","null"]},"job_id":{"type":["string","null"]},"status":{"enum":["delivered","paid_not_delivered"],"type":"string"},"resource":{"type":"string"},"receipt_id":{"type":["string","null"]},"deliverable":{"type":["object","null"],"required":["kind","summary"],"properties":{"csv":{"type":"string"},"kind":{"type":"string"},"changes":{"type":"object","properties":{"cells_trimmed":{"type":"integer"},"duplicates_removed":{"type":"integer"},"empty_rows_removed":{"type":"integer"}}},"summary":{"type":"string"}}}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"status":"delivered","resource":"data-clean","deliverable":{"csv":"name,price\nA,100\nB,","kind":"data-clean","changes":{"cells_trimmed":0,"duplicates_removed":1,"empty_rows_removed":0},"summary":"3 rows -> 2 rows"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0025","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0025/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0025","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0025","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UuCSro95QHKXWIM1P3mG5","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0025","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Cleans tabular data (CSV/TSV/JSON) by removing duplicates, trimming whitespace, and stripping empty rows","exampleAgentPrompt":"Can you clean up this CSV for me — remove any duplicate rows, strip leading/trailing whitespace from cells, and drop empty rows? Here's the data: name,price\\nA,100\\nB,200\\nA,100\\nC,","exampleUseCases":[{"title":"Deduplicate customer list before CRM import","prompt":"I have a CSV of customer records exported from our old system with lots of duplicate rows and extra spaces — can you clean it up and remove the duplicates before I import it into the CRM? Here's the data: id,name,email\\n1, Alice ,alice@example.com\\n2,Bob,bob@example.com\\n1, Alice ,alice@example.com"},{"title":"Sanitize survey responses for analysis","prompt":"These survey results came in as a JSON array and they're messy — there are blank entries and some rows appear twice. Can you clean the data and give me a summary of what changed? [{\"q1\":\"yes\",\"q2\":\"\"},{\"q1\":\"no\",\"q2\":\"maybe\"},{\"q1\":\"yes\",\"q2\":\"\"}]"},{"title":"Prepare product catalog TSV for bulk upload","prompt":"I've got a TSV of product names and prices that has some empty lines and duplicate entries from a merge — can you clean it up and return a tidy CSV? name\\tprice\\nWidget A\\t9.99\\nWidget B\\t14.99\\n\\nWidget A\\t9.99"}],"resultDescription":"Returns a JSON object with ok status, a cleaned CSV string, the kind of operation performed, a human-readable summary (e.g. '3 rows -> 2 rows'), and a changes object detailing cells_trimmed, duplicates_removed, and empty_rows_removed counts.","failureModes":["Input data exceeds 60,000 character limit — returns error","Invalid or unrecognizable format when auto-detection fails — returns error","Malformed JSON array input — returns error","Payment not processed (paid_not_delivered status) — deliverable is null","Empty input data — may return unchanged empty result"],"whenToPreferThis":"Choose this endpoint when you need a quick, paid micro-service to clean tabular data (CSV, TSV, or JSON arrays) by removing duplicates, trimming whitespace, and dropping empty rows — especially in automated pipelines where data arrives dirty from merges or exports. It is best suited for datasets under 60,000 characters where the output format (CSV) is acceptable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T12:35:59.968Z","isFirstParty":false,"canonicalSlug":"wealth-agent-data-clean-e577b9ae"}