Skip to main content
Glama

ai_sql_review

Read-only

SQL query review — Review a SQL query: exact rule-based lint (UPDATE/DELETE without WHERE, DROP/TRUNCATE, SELECT *, leading-wildcard LIKE, functions on indexed columns, NOT IN with NULLs, ORDER BY random, deep OFFSET, comma cross joins, string-built SQL injection risk) plus an AI explanation of what it does, execution steps, performance tips, index suggestions and logic bugs. Pass sql=; optional dialect= and schema= (CREATE TABLE text). Returns overall risk LOW/MEDIUM/HIGH/CRITICAL. Price: $0.008 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": "ai_sql_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesSELECT * FROM orders WHERE LOWER(email) = 'a@b.com'

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.4/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint, openWorldHint, destructiveHint=false), the description discloses substantial behavior: the response's risk scale (LOW/MEDIUM/HIGH/CRITICAL), the split between deterministic rule-based lint and LLM explanation, and the price/payment path ($0.008 USDC via x402). The notable remaining gap is whether the supplied SQL is actually executed anywhere, which an agent inspecting a 'review' tool would reasonably want to know.

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?

The definition is front-loaded with the verb and resource, then the check list, then the return scale and price — a logical order with no filler sentences. The parenthetical rule enumeration is dense but each item carries information; only the trailing pricing sentence is tangential to selecting the tool.

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?

For a single-parameter analysis tool with no output schema, the description does well by naming the risk levels returned and the analysis components. It falls short on two points an agent needs: whether the query is executed or only statically analyzed, and the undocumented dialect/schema parameters that appear in prose but not in the schema.

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

Parameters2/5

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

The description advertises "optional dialect= and schema= (CREATE TABLE text)", but the input schema defines only a single property, sql — so two of the three parameters discussed are not callable. That mismatch can actively mislead an agent into passing arguments that do not exist, and the one real parameter (sql) gets only an example value rather than a stated format in either place.

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 states a specific verb and resource ("Review a SQL query") and enumerates the exact checks performed (missing WHERE, DROP/TRUNCATE, SELECT *, leading-wildcard LIKE, etc.), so its purpose is unmistakable. It does not, however, explicitly differentiate itself from the closest sibling 'ai_sql' (e.g., generate vs. audit), leaving the distinction to inference.

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 — the agent can infer this is for auditing existing queries, and the note that schema= accepts CREATE TABLE text hints that supplying DDL improves index suggestions. There is no statement of when to use this versus alternatives, no prerequisites, and no exclusions (e.g., whether the query is ever executed).

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