# CSV to JSON

Turn CSV rows into a JSON array of objects, detecting numbers, booleans and blanks.

- Endpoint: `POST https://setget.net/v1/tools/csv-to-json` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `csv-to-json`
- Page: https://setget.net/tools/csv-to-json

## Inputs

- `text` (required, string): The CSV to convert.
- `delimiter` (optional, string, one of `auto`, `comma`, `tab`, `semicolon`, `pipe`, default `"auto"`): Column separator. "auto" detects it from the first line.
- `header` (optional, boolean, default `true`): The first row holds column names.
- `infer_types` (optional, boolean, default `true`): Turn numbers, true/false and blanks into typed values.
- `indent` (optional, integer, default `2`, range 0..8): Spaces per level. 0 gives one compact line.

## Example

```json
{"input":{"text":"name,age\nSam,31\nAlex,27","indent":0}}
```

Result:

```json
{"text":"[{\"name\":\"Sam\",\"age\":31},{\"name\":\"Alex\",\"age\":27}]","rows":2,"columns":["name","age"]}
```

**Why did "007" stay as text?** Values with leading zeros are usually codes, not numbers, so they are left alone.
