Skip to main content
Glama

Execute SQL

execute_sql
Destructive

Run 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

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoDefault schema for unqualified names.
catalogNoDefault catalog for unqualified names.
confirmNoSet 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_runNoIf true, validate and return the planned change without executing it.
max_rowsNoMaximum rows to return (capped by DBX_MCP_SQL_MAX_ROWS).
statementYesA single SQL statement (SELECT, DDL or DML). Use execute_sql_multi for scripts.
parametersNoNamed parameters referenced as :name in the statement (values are bound server-side, never interpolated).
row_formatNo'arrays' (compact, aligned with columns) or 'objects' (one dict per row).arrays
warehouse_idNoSQL warehouse id. If omitted: DBX_MCP_DEFAULT_WAREHOUSE_ID, else automatic selection (reported in the response).
wait_timeout_secondsNoSeconds to wait (5-50) before returning a pending statement id.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
pageNo
planNo
toolYes
actionNo
safetyNo
statusNosuccess
summaryYes
warningsNo
next_stepsNoSuggested follow-up calls.
request_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing the statement classification scheme (read/write/destructive/security-sensitive and what falls in each bucket), the confirm gating behavior, row capping via max_rows, and the 'pending' status when wait_timeout_seconds elapses. The annotations only broadly declare destructiveHint=true; the description explains exactly which inputs trigger destructive behavior and what the response envelope contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then classification/safety rules, then response shape and timeout behavior. Dense but each sentence carries actionable content. The trailing 'Safety classification' line restates the classification rules already enumerated above, which is mild redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers classification, safety gating, dry-run/confirm flow, timeout and polling, row capping, and warehouse selection for a 10-parameter, high-stakes tool. An output schema exists, yet the description still usefully sketches the data.result/data.execution split, leaving no material gap for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, so the baseline is 3. The description adds operational meaning by tying parameters together: max_rows caps returned rows, the wait_timeout/pending path connects to a follow-up tool, and warehouse selection falls back through env var to automatic selection reported in the response. Some of this repeats the schema, keeping it below 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (execute one SQL statement) and the exact backend (Databricks SQL warehouse via the Statement Execution API). It also implicitly distinguishes itself from the sibling execute_sql_multi (scripts) and manage_sql_statement (polling a pending statement by id), so an agent can separate it from neighbors without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete conditional guidance: destructive/security-sensitive statements require confirm=true, and a still-running statement should be polled with manage_sql_statement. It does not explicitly say when NOT to use this tool (e.g. multi-statement scripts), though that alternative is named in the statement parameter description rather than in the prose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.