Skip to main content
Glama

util_sql_lint

Read-only

SQL linter, formatter and safety check — Static analysis of SQL before you run it (nothing is executed). Splits statements, reports each statement's type, tables read/written/deleted/dropped, parameters and whether it is read-only, then lints: UPDATE/DELETE without WHERE, DROP/TRUNCATE/ALTER DROP, GRANT ALL, OR 1=1 tautologies, stacked queries, file/system/sleep functions (OUTFILE, xp_cmdshell, pg_sleep), SELECT *, = NULL, NOT IN subquery NULL trap, leading-wildcard LIKE, cartesian comma joins, ORDER BY RANDOM(), INSERT without columns, LIMIT without ORDER BY, deep OFFSET, NOLOCK. Verdict OK/REVIEW/DANGEROUS/INVALID plus safe_to_auto_execute, a formatted version and a minified one. dialect=generic|postgres|mysql|sqlite|tsql. Pairs with /v1/ai/sql for agents that generate SQL. Price: $0.003 USDC (Base, via x402).

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": "util_sql_lint"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesselect * from users where email = null; delete from sessions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, and the description reinforces this with 'nothing is executed,' which matters for a tool ingesting destructive SQL. It goes well beyond the annotations by disclosing the analysis output (statement type, tables read/written/deleted/dropped, parameters, read-only flag), the verdict tiers, safe_to_auto_execute, formatted and minified outputs, and even the per-call price — no output schema so this detail is essential and well supplied.

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?

Purpose, non-execution guarantee and output shape are front-loaded, then the lint-rule catalogue follows as a dense but functional list of covered checks. The enumeration of 15+ rules is long and comma-crammed, but each entry conveys concrete coverage information rather than filler.

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?

With no output schema, the description fully carries the return-value burden and does so (verdict, safe_to_auto_execute, formatted/minified). The only real gap is the dialect option being described but not represented in the input schema, which could confuse an agent trying to pass it.

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 coverage is 100% for the single 'sql' parameter, so the baseline is 3 even though the description adds that statements are split and multiple statements are accepted ('Splits statements'). The description also mentions a 'dialect=generic|postgres|mysql|sqlite|tsql' option that does not appear anywhere in the input schema, which is a mismatch rather than clarification.

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 definition names a specific verb set and resource — 'SQL linter, formatter and safety check' — and immediately scopes it with 'Static analysis of SQL before you run it (nothing is executed).' It also distinguishes itself from the sibling ai_sql by noting it 'Pairs with /v1/ai/sql for agents that generate SQL,' so an agent can separate analysis from generation without opening schemas.

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?

Usage is clearly implied by 'before you run it' and the pairing note with the SQL-generation tool, which tells the agent when to reach for this vs. a generator. However, it does not name ai_sql_review as an alternative or state any explicit when-not-to-use condition, so it falls short of full routing guidance.

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.

Resources