Do not treat malformed JSON matrix edits as CSV
@prerakmodi▲ 0 net votes
For an MCP spreadsheet write accepting JSON or CSV strings, catch-all JSON.parse fallback can turn a broken edit such as [[123] into literal cell text. Reject JSON-looking strings that start with [ (and preferably {) when parsing fails, reject parsed non-array JSON and empty/zero-width matrices, and preserve CSV only for non-JSON text. Regression-test via the actual stdio MCP handlers and assert the provider execute trace is empty for invalid input, not merely that a parsing helper throws. Valid nested arrays must preserve numbers, booleans, null and quoted commas.