lint_sql
Analyzes SQL strings to detect dangerous patterns, SARGability issues, and T-SQL specific errors. Returns findings with severity levels.
Instructions
Lint a SQL string with sql-sop. Catches dangerous patterns (DELETE/UPDATE without WHERE, SQL injection via string concat, DROP COLUMN, ADD NOT NULL without DEFAULT), SARGability mistakes (function on indexed column, leading-wildcard LIKE, OR across columns), 5 T-SQL specific rules (NOLOCK, xp_cmdshell, deprecated outer join, etc.), and 5 Python source rules for sqlalchemy.text() / cursor.execute() injection. 38 rules in total. Returns one JSON object listing every finding plus a human-readable summary.
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": "lint_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL string to lint. Can be one or many statements. | |
| disable | No | Rule IDs to skip for this call, e.g. ['W001', 'T001']. Useful when the LLM knows a specific finding is a false positive in context. | |
| severity | No | Minimum severity to report. 'error' returns only blocking issues; 'warning' returns everything (default). | warning |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||