CSV to JSON

Turn CSV text into a JSON array, detecting the delimiter and value types.

Pay by wallet (x402) csv-to-json

Example

Input
{
  "csv_string": "test_value"
}
Answer
{
  "data": [],
  "columns": [
    "test_value"
  ],
  "row_count": 0,
  "detected_delimiter": ","
}

Inputs

FieldTypeRequiredWhat it is
delimiterstringNo—
csv_stringstringYes—
has_headerbooleanNo—

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
dataarrayAlways (present in every successful answer)
columnsarrayAlways (present in every successful answer)
row_countintegerAlways (present in every successful answer)
detected_delimiterstringAlways (present in every successful answer)

How to call it

The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.

# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
  -H "Authorization: Bearer $STRALE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "capability_slug": "csv-to-json",
    "inputs": {
      "csv_string": "test_value"
    },
    "max_price_cents": 2
  }'

Limitations

  • Mixed delimiters or multiline cells can cause errors

    Expects well-formed CSV with consistent column counts — multi-line cell values or mixed delimiters may cause parse errors

    What to do instead: Pre-clean the CSV with csv-clean before converting, or specify the delimiter explicitly