SQL Formatter API - beautify or minify SQL
sql_formatterFormat SQL for MySQL, PostgreSQL, SQL Server, SQLite and more: line breaks, indents, keyword case (UPPER/lower/as typed), optional leading commas and comment removal; or minify to one line. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/sql-formatter.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "select a.id,b.name from users a join orders b on a.id=b.user_id where b.total>100 order by b.name"
},
"name": "sql_formatter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | format or minify | format |
| text | Yes | Your SQL | |
| indent | No | 2 or 4 spaces | 2 |
| keywords | No | upper, lower or keep | upper |
| leadingCommas | No | Comma at the start of the line | |
| removeComments | No | Remove comments |