Skip to main content
Glama
gswartwood

sqlfluff-mcp-server

by gswartwood

fix_sql

Corrects SQL syntax and style issues in a SQL string based on a specified dialect, returning the fixed SQL text.

Instructions

Fix a raw SQL string using an explicitly specified dialect and return the fixed SQL text (does not touch any file).

Args: sql: The SQL text to fix. dialect: SQLFluff dialect name, e.g. "ansi", "bigquery", "snowflake", "postgres". rules: Optional list of rule codes/names to restrict fixing to.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
rulesNo
dialectYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the burden. It discloses that it returns the fixed SQL text, does not touch any file, and requires an explicitly specified dialect. It lacks details on error handling or side effects, but these are minimal for a pure string transformation.

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 concise and front-loaded with the purpose, followed by a compact Args section. Every sentence adds value, with no redundancy.

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

Completeness5/5

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

The tool is simple (fix SQL string), and the description covers its purpose, parameters, return value, and safety property ('does not touch any file'). Although an output schema exists, the description already states the return type, making it complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully compensates by explaining each parameter: 'sql' as text to fix, 'dialect' with concrete SQLFluff examples, and 'rules' as optional restrictions. This adds meaning beyond the bare schema.

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 action: 'Fix a raw SQL string using an explicitly specified dialect and return the fixed SQL text'. It also explicitly notes 'does not touch any file', distinguishing it from file-based siblings like fix_file.

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?

The description implies when to use this tool (for raw SQL strings) and, via the parenthetical 'does not touch any file', distinguishes it from file-based tools. It does not explicitly name alternatives or state exclusions, but the scope is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gswartwood/sqlfluff-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server