# Sql To Json — REST API endpoint `sql-to-json`

Read rows out of SQL INSERT statements (mysqldump, SQLite dump, pg_dump made with --inserts; PostgreSQL COPY blocks are not read) and return JSON: an array of objects, or an object keyed by table when the dump holds rows for more than one table. The SQL is parsed as text — nothing is executed. Column names come from the INSERT column list, then from a CREATE TABLE in the same input, then from positions (column_1, column_2, ...). NULL becomes null, unquoted TRUE/FALSE become booleans, unquoted numbers become JSON numbers unless a double cannot hold them exactly (beyond ±9007199254740991 or more than 15 significant digits), in which case they stay strings. Quoted values stay strings; with coerce_numbers a quoted column becomes numbers only when every quoted value in that column writes back as the same text, so a column holding '007' stays all strings. Functions and keywords such as NOW() or DEFAULT are not evaluated: their SQL text is kept as a string and listed in notes. Hex and bit literals stay as text. An INSERT ... SELECT has no literal rows and is listed in skipped rather than guessed at.

- Category: data
- MCP server: https://mcp.findutils.com/ (Streamable HTTP, no API keys, 120 req/min per IP)
- REST endpoint: POST https://api.findutils.com/api/tools/sql-to-json/execute (no API keys, 60 req/min per IP)
- Reference page: https://findutils.com/api/sql-to-json/
- Same tool on the other surface: https://findutils.com/mcp/sql-to-json/

## Call the endpoint (verified example)

```bash
curl -X POST https://api.findutils.com/api/tools/sql-to-json/execute \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "INSERT INTO people (id, name, active) VALUES (1, '\''Ada'\'', TRUE), (2, NULL, FALSE);"
  }'

# Parameter schema
curl https://api.findutils.com/api/tools/sql-to-json
```

## Input schema

| Argument | Type | Required | Description |
|---|---|---|---|
| `sql` | string | yes | SQL dump text containing INSERT statements. |
| `group_by_table` | string (auto \| always \| never) | no | 'auto' returns an object keyed by table only when more than one table has rows; 'always' always keys by table; 'never' returns one flat array. Default: `"auto"`. |
| `coerce_numbers` | boolean | no | Turn QUOTED numbers into JSON numbers, decided per column: a column converts only when every quoted value in it is a canonical number (such as '42' or '-3.5'), so a column holding '007', '1.50', '+3' or '1e5' stays all strings. Unquoted numbers are always numbers. Default: `true`. |
| `include_table_key` | boolean | no | In a flat array, add a "__table" field naming each row's table. Ignored when grouped. Default: `false`. |
| `indent` | integer (0 \| 2 \| 4) | no | Spaces of indentation in the json string. 0 gives minified output. Default: `2`. |
| `table` | string | no | Return only this table. Default: every table found. |
| `max_rows` | integer | no | Stop after this many rows per table. Default 50000, maximum 200000. Default: `50000`. |

Example arguments (verified):

```json
{
  "sql": "INSERT INTO people (id, name, active) VALUES (1, 'Ada', TRUE), (2, NULL, FALSE);"
}
```

OpenAPI 3.1 spec: https://findutils.com/api/openapi.json · Interactive docs: https://findutils.com/api/docs/

## Also an MCP tool

```bash
claude mcp add findutils --transport http https://mcp.findutils.com/
```

Then ask the client to call `findutils:sql_to_json`. Full MCP reference: https://findutils.com/mcp/sql-to-json/

---
Full catalog: GET https://api.findutils.com/api/tools · https://findutils.com/api/ · https://findutils.com/llms.txt
