Skip to main content
Glama

SQL Formatter API - beautify or minify SQL

sql_formatter
Read-onlyIdempotent

Format 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

NameRequiredDescriptionDefault
modeNoformat or minifyformat
textYesYour SQL
indentNo2 or 4 spaces2
keywordsNoupper, lower or keepupper
leadingCommasNoComma at the start of the line
removeCommentsNoRemove comments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds substantial context beyond the annotations: it runs server-side, files are deleted right after the call with nothing stored, and it documents the free tier (5 calls/day per IP) plus the two paid auth paths (X-API-Key or x402 per-call pricing with URLs). The annotations only cover readOnly/idempotent/openWorld, so the privacy and billing disclosure is genuinely new value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense and front-loaded: capability first, then operational and pricing details. The pricing URLs and euro/dollar amounts are slightly verbose, but they carry needed auth information rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a stateless text-transformation tool with full schema coverage and annotations declaring safety, the only things an agent needs beyond the schema are privacy and auth, both supplied. The absence of an output schema is low-risk since formatted SQL is the evident return.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and every parameter carries an enum or description, so the schema already does the heavy lifting. The description restates keyword case and leading commas but adds no syntax or format detail beyond the schema, which is the expected baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Format SQL') plus the dialects supported, and immediately covers the two output modes: beautified SQL with line breaks/indents/keyword case, or minified to one line. An agent can distinguish this from json_formatter without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The format-vs-minify choice is spelled out, giving clear context for which mode to pick, and the option set (indent, keyword case, leading commas, comment removal) is enumerated. It stops short of explicit when-not guidance or naming a sibling alternative, so it is not a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources