Execute SQL
execute_sqlRun a single SQL statement on a Databricks SQL warehouse with automatic safety classification, confirmation for destructive changes, and parameterized execution.
Instructions
Execute one SQL statement on a Databricks SQL warehouse via the Statement Execution API.
The statement is classified before running: SELECT/SHOW/DESCRIBE are reads; INSERT/CREATE
are writes; DROP/DELETE/TRUNCATE/UPDATE/MERGE/OR REPLACE/INSERT OVERWRITE are destructive and
GRANT/REVOKE/ownership/row-filter/mask changes are security-sensitive. Destructive and
security-sensitive statements require confirm=true. The response separates data.result
(columns, rows, truncation) from data.execution (statement id, state, warehouse used and why).
Rows are capped by max_rows. If the statement is still running after wait_timeout_seconds the
response has status 'pending' - poll with manage_sql_statement.
Safety classification: depends on input (DESTRUCTIVE, EXECUTION, READ_ONLY, SECURITY_SENSITIVE, WRITE).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Default schema for unqualified names. | |
| catalog | No | Default catalog for unqualified names. | |
| confirm | No | Set to true ONLY after the user has reviewed the plan returned by a previous call with status 'confirmation_required'. Required for destructive/security-sensitive actions. | |
| dry_run | No | If true, validate and return the planned change without executing it. | |
| max_rows | No | Maximum rows to return (capped by DBX_MCP_SQL_MAX_ROWS). | |
| statement | Yes | A single SQL statement (SELECT, DDL or DML). Use execute_sql_multi for scripts. | |
| parameters | No | Named parameters referenced as :name in the statement (values are bound server-side, never interpolated). | |
| row_format | No | 'arrays' (compact, aligned with columns) or 'objects' (one dict per row). | arrays |
| warehouse_id | No | SQL warehouse id. If omitted: DBX_MCP_DEFAULT_WAREHOUSE_ID, else automatic selection (reported in the response). | |
| wait_timeout_seconds | No | Seconds to wait (5-50) before returning a pending statement id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| page | No | ||
| plan | No | ||
| tool | Yes | ||
| action | No | ||
| safety | No | ||
| status | No | success | |
| summary | Yes | ||
| warnings | No | ||
| next_steps | No | Suggested follow-up calls. | |
| request_id | No |