run_sql
Execute read-only SQL SELECT queries against a database connection, returning rows, columns, row count, and execution time while rejecting unsafe statements.
Instructions
Execute a read-only SQL SELECT against the target database and return the rows.
Use to run SQL you wrote from get_semantic_context. Enforces read-only: rejects INSERT/UPDATE/DELETE/DDL and other unsafe statements; results are row-limited per the connection's max_rows. Returns columns, rows, row_count, truncated, and execution_time_ms. To have the server write the SQL for you, use generate_sql or ask.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | Yes | Target database connection — its name or id (case-insensitive). List the available connections with list_connections. | |
| sql | Yes | A single read-only SELECT statement to execute. Non-SELECT or unsafe SQL is rejected. |