Skip to main content
Glama
gswartwood

sqlfluff-mcp-server

by gswartwood

fix_file

Fix SQL files with SQLFluff, respecting .sqlfluff config. Optionally write the corrected SQL back to the file or return it.

Instructions

Fix a SQL file on disk, honoring discovered .sqlfluff config.

Args: path: Path to the SQL file to fix. write: If True, overwrite the file in place with the fixed SQL. If False (default), just return the fixed SQL without touching the file. config_path: Optional path to an extra config file to layer on top of whatever is discovered by walking the directory tree.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
writeNo
config_pathNo

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 behavioral burden and does so by explaining the write flag: overwriting in place when True, and returning fixed SQL without touching the file when False. It also notes config layering behavior, though it omits error/permission details.

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 short, front-loaded, and uses a clear Args list. Every sentence adds useful information with no filler.

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?

Given the simple 3-parameter tool and presence of an output schema, the description covers purpose, side effects, and parameter behavior completely. It does not need to restate return values thanks to the output schema.

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 Args block fully explains path, write semantics, and config_path layering. This adds meaning beyond the bare schema and compensates for the lack of structured descriptions.

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 opening line 'Fix a SQL file on disk' uses a specific verb and resource, immediately clarifying the tool's function. It also distinguishes from sibling fix_sql by scoping to files, and mentions config honoring.

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 clearly implies file-based usage via 'on disk' and the path parameter, giving context for when to choose this over SQL-string tools. It does not explicitly name alternatives or exclusions, but the file scope is unambiguous.

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