API & MCP

Everything a person can do on Opsdeck SQL Formatter & Linter, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Opsdeck SQL Formatter & Linter

Formats SQL statements with clauses on their own lines, one select item per line, indented AND/OR conditions, subqueries and CREATE TABLE bodies, and keywords in the case you choose; comments are kept and formatting twice changes nothing. The linter flags UPDATE or DELETE without WHERE, SELECT * in views, comma joins without a condition, “= NULL”, NOT IN with a subquery, leading-wildcard LIKE, destructive statements and INSERT without a column list. It is the formatter of the Opsdeck Database desk.

Inputs of Opsdeck SQL Formatter & Linter
FieldTypeDefaultDescription
sqltextarea"select c.name, count(*) as orders, sum(o.total) total from customers c join ordSQL
keywordCaseselect (upper, lower, preserve)"upper"Keyword case
indentinteger2Indent width

Example request

Report query with joins, grouping and a date range

curl -X POST https://opsdecksqlformatter.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "opsdeck-sql-formatter": { "type": "http", "url": "https://opsdecksqlformatter.usefulweb.site/mcp" }
  }
}