Skip to main content
Glama

SQL format / minify

sql_format
Read-onlyIdempotent

Format SQL text or .sql files into readable clauses with indentation and case options, or minify statements to one line while keeping or dropping comments.

Instructions

Format SQL (one clause per line, indented sub-queries, CASE blocks, JOIN … ON with AND/OR, CREATE TABLE column lists) or minify it to one line per statement. Options: keyword case (UPPER, lower, keep), indent (2, 4, tab), trailing or leading commas, keep/drop comments when minifying. Dialect-neutral tokenizer: understands -- and /* */ comments, '' and E''' strings, "x", x and [x] identifiers, $$ dollar quotes, ::casts, JSON operators, :name/$1/? parameters. Only re-spaces; never runs anything. Give "text" or a file "path". Web version: https://s3eidat.github.io/sql-format/

Input Schema

NameRequiredDescriptionDefault
modeNo"format" (default) or "minify".format
pathNoOr: a path to a .sql file (UTF-8; use this for big inputs).
textNoThe SQL as inline text.
commasNoPut list commas at line ends (trailing) or starts (leading).trailing
indentNoIndentation: 2, 4 or "tab".2
outputNoOptional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file.
keywordCaseNoKeyword and built-in function case.upper
keepCommentsNoMinify only: keep comments (as /* */). Optimizer hints /*+ */ and /*! */ are always kept.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and closed-world behavior, and the description adds meaningful context: the dialect-neutral tokenizer supports comments, strings, identifier quoting, dollar quotes, casts, JSON operators, and parameters. The statement "Only re-spaces; never runs anything" directly reinforces the safety profile beyond what the annotations provide.

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?

The description is front-loaded with the primary format/minify purpose, then moves into options, dialect support, safety behavior, and input methods. It is dense but well structured; the web-version link and tokenizer detail are useful context rather than filler.

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

Completeness4/5

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

For a formatting tool with eight optional parameters and no output schema, the description covers purpose, modes, input sources, formatting options, dialect support, and read-only safety. It could more explicitly state the return value, but the output parameter schema already explains when result text is returned versus written to a file.

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?

The schema has 100% description coverage and already documents all eight parameters, including enums, defaults, and output behavior. The description reinforces the available options but adds little semantic detail beyond what the schema already says, so the baseline score of 3 is appropriate.

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?

The description starts with a precise verb and resource: format SQL or minify it. It immediately distinguishes the two modes and lists concrete formatting behaviors such as clause-per-line, indented subqueries, CASE blocks, and JOIN … ON handling, so an agent knows exactly what the tool does.

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?

It clearly explains how to choose between formatting and minifying via the mode option, and how to provide input using inline text or a file path. It also says the tool only re-spaces and never runs anything, which implicitly distinguishes it from SQL execution siblings such as ai_sql_query, though it does not explicitly name that alternative.

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

Deploy Server

Other Tools