Skip to main content
Glama

Format SQL

format_sql
Read-onlyIdempotent

Format SQL for PostgreSQL, MySQL, BigQuery, Snowflake, and other dialects. Choose keyword case and an indent of 2 or 4 spaces.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "format_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesSQL to format.
indentNo
dialectNopostgresql
keywordCaseNoupper

Output Schema

NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is covered. The description adds that multiple dialects are supported and that output styling is configurable, but it says nothing about behavior on invalid or unparseable SQL, which is the main unknown for a formatter. No contradiction with annotations.

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?

Two short sentences, front-loaded with the core action and scope. The second sentence partially restates options already visible in the schema enums, which is minor redundancy but not enough to hurt readability.

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?

An output schema exists, so return values need no explanation, and the tool is a simple pure transform. The description covers the main axes of variation (dialect, case, indent); only error handling for malformed SQL is unaddressed.

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 only 25%, so the description has to compensate, and it partially does by naming supported dialects and stating indent accepts 2 or 4 spaces. It omits the keywordCase 'preserve' option, the defaults (postgresql, upper, 2), and never says the sql parameter is required, leaving gaps the schema enum alone doesn't fully close.

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

Purpose4/5

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

The description names a specific verb (Format) and resource (SQL) and scopes it to a set of dialects including PostgreSQL, MySQL, BigQuery, and Snowflake. That is enough to distinguish it from generic siblings like convert_case or format_json, though it never explicitly contrasts itself with them.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer it should call this when it has SQL text to reformat. There is no explicit statement of when not to use it, no mention of prerequisites, and no pointer to an alternative tool for non-SQL formatting.

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.