validate_sql_query
Detect SQL injection in dynamically built queries before execution. Blocks UNION attacks, stacked queries, comment injection, blind SQLi, and encoding tricks in strict or advisory mode.
Instructions
Prevent SQL injection. Detects UNION attacks, stacked queries (DROP TABLE), comment injection (--), boolean/time-based blind SQLi, and encoding tricks. Validate all dynamically constructed SQL before execution.
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": {
"query": "<query>"
},
"name": "validate_sql_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Validation mode (default: strict) | |
| query | Yes | The SQL query string to validate | |
| sensitivity | No | Detection sensitivity (default: medium) | |
| allowedKeywords | No | SQL keywords to allow (e.g., ['SELECT', 'INSERT', 'UPDATE']) |