# Sql Formatter — REST API endpoint `sql-formatter`

Format (beautify) or minify a SQL query and return the result with lint warnings. Format mode puts each clause (SELECT, FROM, WHERE, JOIN, ...) on its own line, uppercases keywords, and indents by the chosen width; dialect adds MySQL, PostgreSQL, or SQLite keywords. Warnings flag unmatched parentheses, unclosed strings, empty clauses, and a missing final semicolon.

- Category: developer
- 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-formatter/execute (no API keys, 60 req/min per IP)
- Reference page: https://findutils.com/api/sql-formatter/
- Same tool on the other surface: https://findutils.com/mcp/sql-formatter/

## Call the endpoint (verified example)

```bash
curl -X POST https://api.findutils.com/api/tools/sql-formatter/execute \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "select id, name from users where id = 1;"
  }'

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

## Input schema

| Argument | Type | Required | Description |
|---|---|---|---|
| `sql` | string | yes | The SQL text to format or minify. |
| `mode` | string (format \| minify) | no | format = beautify, minify = one line without comments. Default: format. Default: `"format"`. |
| `indent` | integer | no | Spaces per indentation level in format mode (1-8). Default: 2. Default: `2`. |
| `dialect` | string (standard \| mysql \| postgresql \| sqlite) | no | SQL dialect for keyword recognition. Default: standard. Default: `"standard"`. |

Example arguments (verified):

```json
{
  "sql": "select id, name from users where id = 1;"
}
```

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_formatter`. Full MCP reference: https://findutils.com/mcp/sql-formatter/

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