Run read-only SQL query
run_queryExecute a single read-only SELECT query against Microsoft SQL Server with validation, table allowlists, row limits, and timeouts to prevent writes.
Instructions
Execute a single read-only SELECT statement (WITH/CTE supported) against the database. Every query is validated first: exactly one statement, SELECT-only, no write/exec keywords, optional table allowlist. Results are truncated at the configured MAX_ROWS (reported via the "truncated" flag) and a query timeout applies. Rejected queries name the exact rule that was violated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single T-SQL SELECT statement (CTEs allowed) |