You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor create_or_update_genie function for improved clarity and functionality
- Streamline the logic for handling serialized_space, ensuring clearer separation of update and create operations.
- Enhance error handling for non-existent Genie spaces when updating by ID.
- Update documentation to reflect changes in the usage of ask_genie and ask_genie_followup tools, clarifying their purposes and examples.
- Revise examples in conversation and SKILL documentation to align with the new function structure and naming conventions.
Copy file name to clipboardExpand all lines: databricks-skills/databricks-genie/SKILL.md
+81-20Lines changed: 81 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Use this skill when:
33
33
|------|---------|
34
34
|`list_genie`| List all Genie Spaces accessible to you |
35
35
|`create_or_update_genie`| Create or update a Genie Space (supports `serialized_space`) |
36
-
|`get_genie`|Get space details (by ID and support `include_serialized_space` parameter) or list all spaces (no ID) |
36
+
|`get_genie`| Get Genie Space details (supports `include_serialized_space`) |
37
37
|`delete_genie`| Delete a Genie Space |
38
38
|`export_genie`| Export a Genie Space with full serialized configuration |
39
39
|`import_genie`| Import / clone a Genie Space from a serialized payload |
@@ -42,7 +42,8 @@ Use this skill when:
42
42
43
43
| Tool | Purpose |
44
44
|------|---------|
45
-
|`ask_genie`| Ask a question or follow-up (`conversation_id` optional) |
45
+
|`ask_genie`| Ask a question to a Genie Space, get SQL + results |
46
+
|`ask_genie_followup`| Ask follow-up question in existing conversation |
46
47
47
48
### Supporting Tools
48
49
@@ -113,28 +114,92 @@ import_genie(
113
114
114
115
#### Example: Migrating Genie Spaces from Prod to Dev
115
116
116
-
When migrating Genie Spaces between environments (e.g., from a `prod` target to a `dev` target defined in your `databricks.yml`), you must update the catalog references within the serialized space.
117
+
When migrating Genie Spaces between environments (e.g., from a `prod` target to a `dev` target defined in your `databricks.yml`), you must update the catalog references within the serialized space.
117
118
118
119
**Note:** Genie Space migration assumes that the underlying data assets (schemas and tables) remain structurally identical across environments. The migration of the actual catalogs, schemas, or tables themselves is outside the scope of Genie Space migration skills.
119
120
120
-
For instance, if your production tables reside in the `healthverity_claims_sample_patient_dataset` catalog, but your development tables are in `healthverity_claims_sample_patient_dataset_dev`, you can perform a string replacement on the exported configuration before importing it into the target workspace:
121
+
##### The Challenge: MCP Servers Are Workspace-Scoped
122
+
123
+
Each Databricks MCP server instance connects to exactly one workspace (set via `DATABRICKS_CONFIG_PROFILE` at startup). This means a single MCP server cannot export from PROD and import into DEV in the same session — you need two server instances.
124
+
125
+
##### Recommended Setup: Dual MCP Server Profiles
126
+
127
+
Configure two Databricks MCP server entries in your IDE's MCP config (e.g. `~/.cursor/mcp.json`), one per workspace:
Both servers run simultaneously after one IDE reload. This lets you call `export_genie` against `databricks-prod` and `import_genie` against `databricks-dev` within the same conversation — no further reloads needed.
143
+
144
+
> **Tip:** The Databricks CLI profiles (`prod`, `dev`) referenced above must be defined in `~/.databrickscfg`. Both token-based and OAuth (`auth_type = databricks-cli`) profiles are supported.
145
+
146
+
##### Full Migration Workflow
147
+
148
+
**Step 1 — Export from PROD** using the `databricks-prod` MCP server:
121
149
122
150
```python
123
-
#1. Export the Genie Space from the production workspace
@@ -176,10 +241,6 @@ Use these skills in sequence:
176
241
|**`import_genie` fails with permission error**| Ensure you have CREATE privileges in the target workspace folder |
177
242
|**Tables not found after migration**| Catalog name was not remapped — replace the source catalog name in `serialized_space` before calling `import_genie`|
178
243
|**Catalog name appears in SQL queries too**|`serialized_space` embeds catalog in table identifiers, SQL FROM clauses, join specs, and filters — a single `.replace(src, tgt)` on the whole string covers all occurrences |
179
-
180
-
## Related Skills
181
-
182
-
-**[databricks-agent-bricks](../databricks-agent-bricks/SKILL.md)** - Use Genie Spaces as agents inside Supervisor Agents
183
-
-**[databricks-synthetic-data-gen](../databricks-synthetic-data-gen/SKILL.md)** - Generate raw parquet data to populate tables for Genie
184
-
-**[databricks-spark-declarative-pipelines](../databricks-spark-declarative-pipelines/SKILL.md)** - Build bronze/silver/gold tables consumed by Genie Spaces
185
-
-**[databricks-unity-catalog](../databricks-unity-catalog/SKILL.md)** - Manage the catalogs, schemas, and tables Genie queries
244
+
|**`export_genie` / `import_genie` land in the wrong workspace**| Each MCP server is workspace-scoped. Set up two named MCP server entries (one per profile) in your IDE's MCP config instead of switching a single server's profile mid-session |
245
+
|**MCP server doesn't pick up profile change**| The MCP process reads `DATABRICKS_CONFIG_PROFILE` once at startup — editing the config file requires an IDE reload to take effect |
246
+
|**`import_genie` fails with JSON parse error**| The `serialized_space` string may contain multi-line SQL arrays with `\n` escape sequences; flatten SQL arrays to single-line strings before passing to avoid double-escaping issues |
0 commit comments