Skip to main content
Glama
S-CurveLabs

io.github.S-CurveLabs/sqlglass

Official
by S-CurveLabs

format_sql

Read-only

Format T-SQL into a consistent canonical style by adding AS to aliases and rewriting expressions, without altering the meaning.

Instructions

Pretty-print T-SQL in one canonical style. Normalises cosmetics (adds AS to aliases, rewrites '[x] = expr' aliases to 'expr AS [x]'); meaning is unchanged. Comments inside expressions may move.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

The description discloses that the tool normalizes cosmetics and explicitly warns that 'comments inside expressions may move', a behavioral nuance beyond the readOnlyHint annotation. It also states that meaning is unchanged, providing clarity on side effects. This adds value beyond the annotation, though it does not cover all potential edge cases.

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

Conciseness5/5

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

The description is two sentences with zero filler. The main purpose is front-loaded, followed by concise details on cosmetic changes and a caveat. Every word earns its place.

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 simple single-parameter tool with no output schema, the description covers the operation, the side effect on comments, and semantic preservation. It does not explicitly mention the return value (formatted SQL), but that is implied. Given sibling tools like lint_sql, a brief note that it does not validate syntax could improve completeness, but the description is still sufficient for correct invocation.

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?

With 0% schema description coverage, the description must compensate. It identifies the parameter as 'T-SQL' to be pretty-printed, adding meaning beyond the bare string type. However, it does not specify input format details, constraints, or examples, so the compensation is partial. A baseline 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 clearly states the verb 'pretty-print' and the resource 'T-SQL', with a specific scope ('one canonical style'). It provides concrete examples of the cosmetic normalizations, distinguishing it from sibling tools like lint_sql or analyze_sql. The purpose is unambiguous and not a tautology.

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

Usage Guidelines2/5

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

The description gives no explicit guidance on when to use this tool versus alternatives. It implies usage for formatting T-SQL, but does not mention exclusions (e.g., 'not for syntax validation') or name any sibling tool. An agent might confuse it with lint_sql or translate_sql without additional context.

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