sql-correctness

Validate Databricks SQL traces against Unity Catalog and safety rules.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/itsadijmbt/SecureMCP-Servers --skill sql-correctness-itsadijmbt
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sql-correctness
Source: https://github.com/itsadijmbt/SecureMCP-Servers/tree/main/TEST_SERVERS/PORTED_TO_SECUREMCP/databrickslab-mcp/ai-dev-kit/.test/eval-criteria/sql-correctness
Command: npx skills add https://github.com/itsadijmbt/SecureMCP-Servers --skill sql-correctness-itsadijmbt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents incorrect or unsafe SQL from running on Databricks by enforcing a Databricks-specific correctness rubric for Unity Catalog, syntax, tool choice, and safety.

Core Features & Use Cases

  • Unity Catalog validation: Enforces a 3-level namespace (catalog.schema.table) and rejects unqualified table usage.
  • Databricks SQL best practices: Encourages modern DDL patterns like CREATE OR REPLACE, plus documentation via COMMENT ON and table property updates via SET TBLPROPERTIES.
  • Execution and safety guardrails: Requires mcp__databricks__execute_sql for SQL execution, disallows Bash/CLI and notebook workarounds, and blocks risky SQL patterns like string interpolation and unintended DROP operations.

Quick Start

Ask your AI to evaluate a trace for Databricks SQL correctness using the sql-correctness rubric and report any violations against Unity Catalog usage, syntax, tool selection, feature usage, and safety rules.

Frequently Asked Questions about sql-correctness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate Databricks SQL queries against Unity Catalog conventions?▼

To validate Databricks SQL queries against Unity Catalog conventions, enforce 3-level catalog.schema.table naming patterns and reject unqualified table usage in agent traces. This ensures statements meet platform-specific execution requirements before running.

What is the correct way to execute Spark SQL on Databricks from an AI agent?▼

The correct way to execute Spark SQL on Databricks from an AI agent is mandating the mcp__databricks__execute_sql tool without Bash or notebook workarounds. This enforces safe execution and prevents prohibited CLI bypass behaviors.

How do I detect unsafe SQL interpolation in Databricks agent traces?▼

To detect unsafe SQL interpolation in Databricks agent traces, evaluate execute_sql tool calls and SQL snippets against a correctness rubric that blocks risky string interpolation and unintended DROP operations before platform execution.

Does Unity Catalog require fully qualified table names for Databricks SQL validation?▼

Yes, Unity Catalog requires fully qualified 3-level catalog.schema.table names for Databricks SQL validation. Enforcing this pattern rejects unqualified table usage and ensures queries meet platform-specific correctness requirements.

What are the limitations of using Bash workarounds for Databricks SQL execution?▼

The limitations of using Bash workarounds for Databricks SQL execution include violating safety guardrails that mandate mcp__databricks__execute_sql. Disallowed Bash and notebook workarounds bypass Unity Catalog validation and platform-specific syntax checks.

How do I enforce modern DDL constructs in Spark SQL statements?▼

To enforce modern DDL constructs in Spark SQL statements, apply a validation rubric that prefers CREATE OR REPLACE patterns, adds documentation via COMMENT ON, and updates table properties using SET TBLPROPERTIES before execution.