Skip to main content
Glama

sql-check

SQL guard: single statement, read-only, table allowlist — Checks one SQL string (up to 20000 characters; PostgreSQL, MySQL, SQLite or generic) before an agent executes it: exactly one statement, read-only (SELECT/VALUES/SHOW/EXPLAIN without side effects), and every table it reads or writes on a caller allowlist. Tokenizer-level: comments, string literals, quoted identifiers and dollar quoting cannot hide a second statement; reports statement kind, refere

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": "sql-check"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
dialectNoLexical rules; default ansi.
readOnlyNoDefault true: anything but a plain read fails.
transpileToNoAlways answered unsupported.
allowedTablesNoAllowed tables, lower-cased match: 'users', 'public.users' or 'public.*'. Unqualified and qualified names are different entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the whole burden, and it does disclose substantive behavior: what counts as read-only (SELECT/VALUES/SHOW/EXPLAIN without side effects), that every read and write table is checked against a caller allowlist, and that the check is tokenizer-level so comments, string literals, quoted identifiers and dollar quoting cannot hide a second statement. It omits how failures are surfaced (error vs. structured verdict), and the sentence is cut off mid-word at 'refere', truncating further disclosure.

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?

Well front-loaded: the three enforced invariants appear in the opening clause before the mechanics. Size is appropriate for a 5-parameter validator, but the text terminates mid-word ('refere'), leaving a dangling fragment that wastes the final clause.

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

Completeness3/5

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

There is no output schema, so the description must explain what comes back — and it only manages a truncated 'reports statement kind, refere...', leaving the return shape and failure signaling unspecified. For a guard tool an agent will gate execution on, that is a meaningful gap despite otherwise strong coverage of the validation rules.

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

Parameters4/5

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

Schema coverage is 80%, so the baseline is 3; the description earns an extra point by explaining the semantics behind two parameters — that 'read-only' specifically means SELECT/VALUES/SHOW/EXPLAIN without side effects (readOnly) and that tables read *or written* must be on the allowlist (allowedTables). It adds nothing about dialect lexical differences or the transpileTo trap beyond what the schema already documents.

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?

States a specific verb and resource ('Checks one SQL string ... before an agent executes it') plus the exact invariants enforced: single statement, read-only, table allowlist. The leading tagline 'SQL guard: single statement, read-only, table allowlist' lets an agent distinguish it from the other *-check siblings (regex-check, semver-check) without opening the schema.

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?

'before an agent executes it' gives an explicit usage context — validate prior to execution — which is the key decision point for this tool. It does not name an alternative or state when not to bother calling it (e.g. trusted static SQL), so it stops 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