AugmentClaude

Databricks Genie

Create and query Databricks Genie Spaces for natural language SQL exploration.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up — so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/databricks-genie-databricks-solutions/ — the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates — they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description — no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the “What this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

Create and query Databricks Genie Spaces for natural language SQL exploration. Use when building Genie Spaces, exporting and importing Genie Spaces, migrating Genie Spaces between workspaces or environments, or asking questions via the Genie Conversation API.

What this skill does

Databricks Genie

Create, manage, and query Databricks Genie Spaces - natural language interfaces for SQL-based data exploration.

Overview

Genie Spaces allow users to ask natural language questions about structured data in Unity Catalog. The system translates questions into SQL queries, executes them on a SQL warehouse, and presents results conversationally.

When to Use This Skill

Use this skill when:

  • Creating a new Genie Space for data exploration
  • Adding sample questions to guide users
  • Connecting Unity Catalog tables to a conversational interface
  • Asking questions to a Genie Space programmatically (Conversation API)
  • Exporting a Genie Space configuration (serialized_space) for backup or migration
  • Importing / cloning a Genie Space from a serialized payload
  • Migrating a Genie Space between workspaces or environments (dev → staging → prod)
    • Only supports catalog remapping where catalog names differ across environments
    • Not supported for schema and/or table names that differ across environments
    • Not including migration of tables between environments (only migration of Genie Spaces)

MCP Tools

ToolPurpose
manage_genieCreate, get, list, delete, export, and import Genie Spaces
ask_genieAsk natural language questions to a Genie Space
get_table_stats_and_schemaInspect table schemas before creating a space
execute_sqlTest SQL queries directly

manage_genie - Space Management

ActionDescriptionRequired Params
create_or_updateIdempotent create/update a spacedisplay_name, table_identifiers (or serialized_space)
getGet space detailsspace_id
listList all spaces(none)
deleteDelete a spacespace_id
exportExport space config for migration/backupspace_id
importImport space from serialized configwarehouse_id, serialized_space

Example tool calls:

# MCP Tool: manage_genie
# Create a new space
manage_genie(
    action="create_or_update",
    display_name="Sales Analytics",
    table_identifiers=["catalog.schema.customers", "catalog.schema.orders"],
    description="Explore sales data with natural language",
    sample_questions=["What were total sales last month?"]
)

# MCP Tool: manage_genie
# Get space details with full config
manage_genie(action="get", space_id="space_123", include_serialized_space=True)

# MCP Tool: manage_genie
# List all spaces
manage_genie(action="list")

# MCP Tool: manage_genie
# Export for migration
exported = manage_genie(action="export", space_id="space_123")

# MCP Tool: manage_genie
# Import to new workspace
manage_genie(
    action="import",
    warehouse_id="warehouse_456",
    serialized_space=exported["serialized_space"],
    title="Sales Analytics (Prod)"
)

ask_genie - Conversation API (Query)

Ask natural language questions to a Genie Space. Pass conversation_id for follow-up questions.

# MCP Tool: ask_genie
# Start a new conversation
result = ask_genie(
    space_id="space_123",
    question="What were total sales last month?"
)
# Returns: {question, conversation_id, message_id, status, sql, columns, data, row_count}

# MCP Tool: ask_genie
# Follow-up question in same conversation
result = ask_genie(
    space_id="space_123",
    question="Break that down by region",
    conversation_id=result["conversation_id"]
)

Quick Start

1. Inspect Your Tables

Before creating a Genie Space, understand your data:

# MCP Tool: get_table_stats_and_schema
get_table_stats_and_schema(
    catalog="my_catalog",
    schema="sales",
    table_stat_level="SIMPLE"
)

2. Create the Genie Space

# MCP Tool: manage_genie
manage_genie(
    action="create_or_update",
    display_name="Sales Analytics",
    table_identifiers=[
        "my_catalog.sales.customers",
        "my_catalog.sales.orders"
    ],
    description="Explore sales data with natural language",
    sample_questions=[
        "What were total sales last month?",
        "Who are our top 10 customers?"
    ]
)

3. Ask Questions (Conversation API)

# MCP Tool: ask_genie
ask_genie(
    space_id="your_space_id",
    question="What were total sales last month?"
)
# Returns: SQL, columns, data, row_count

4. Export & Import (Clone / Migrate)

Export a space (preserves all tables, instructions, SQL examples, and layout):

# MCP Tool: manage_genie
exported = manage_genie(action="export", space_id="your_space_id")
# exported["serialized_space"] contains the full config

Clone to a new space (same catalog):

# MCP Tool: manage_genie
manage_genie(
    action="import",
    warehouse_id=exported["warehouse_id"],
    serialized_space=exported["serialized_space"],
    title=exported["title"],  # override title; omit to keep original
    description=exported["description"],
)

Cross-workspace migration: Each MCP server is workspace-scoped. Configure one server entry per workspace profile in your IDE's MCP config, then manage_genie(action="export") from the source server and manage_genie(action="import") via the target server. See spaces.md §Migration for the full workflow.

Reference Files

Prerequisites

Before creating a Genie Space:

  1. Tables in Unity Catalog - Bronze/silver/gold tables with the data
  2. SQL Warehouse - A warehouse to execute queries (auto-detected if not specified)

Creating Tables

Use these skills in sequence:

  1. databricks-synthetic-data-gen - Generate raw parquet files
  2. databricks-spark-declarative-pipelines - Create bronze/silver/gold tables

Common Issues

See spaces.md §Troubleshooting for a full list of issues and solutions.

Related Skills

Related skills