Skill v1.0.0
currentAutomated scan100/100name: sql-formatting description: Format or pretty-print SQL with GoSQLX - consistent indentation, keyword casing and optional trailing semicolon. Use when the user asks to format, beautify, pretty-print, reindent or clean up SQL, or to make a .sql file consistent. argument-hint: "[SQL string or path to .sql file]" allowed-tools: mcp__plugin_gosqlx_gosqlx__format_sql mcp__plugin_gosqlx_gosqlx__validate_sql Read Bash(gosqlx format:*) metadata: version: "1.0.0"
SQL formatting with GoSQLX
Input: $ARGUMENTS - a SQL string or a path to a .sql file.
Steps
- Get the SQL (read the file if a path was given).
- Call
format_sql(mcp__plugin_gosqlx_gosqlx__format_sql) with:
sql(required)indent_size- integer 0–16, default 2.0puts each statement on one line. Clauses always start at column 0; larger values only indent nested blocks such as CREATE TABLE column listsuppercase_keywords-trueupper-cases all keywords (AND,IN,CASE, ...) but not data type names such asint. The defaultfalsestill upper-cases clause keywords (SELECT,FROM,WHERE, ...) and leaves others such asand/oras written; the MCP tool cannot lowercase keywordsadd_semicolon- defaultfalse
- If formatting fails, the SQL probably does not parse: call
validate_sqland report the error instead of guessing a fix. - Show the formatted SQL in a fenced
sqlblock. When the input was a file, write the result back only if the user asked you to change the file; otherwise show it.
Formatting is whitespace and keyword-case only - it must not change meaning. If the output appears to drop or alter anything (comments, hints, dialect syntax), say so and keep the original.
Fallback when the MCP tools are unavailable
gosqlx format query.sql # print formatted SQL (keywords uppercased by default)gosqlx format --indent 4 query.sqlgosqlx format --uppercase=false query.sql # lowercase clause keywords (do not use --no-uppercase: it currently uppercases)gosqlx format --check query.sql # exit non-zero if the file needs formattinggosqlx format -i query.sql # rewrite in place - only when askedecho "select a from b" | gosqlx format
Both upper-case clause keywords by default. For lowercase keywords use the CLI with --uppercase=false.