Skip to content

Add serialized_space support, clone tool, and instruction management for Genie#285

Open
CheeYuTan wants to merge 3 commits intodatabricks-solutions:mainfrom
CheeYuTan:feat/genie-enhancements
Open

Add serialized_space support, clone tool, and instruction management for Genie#285
CheeYuTan wants to merge 3 commits intodatabricks-solutions:mainfrom
CheeYuTan:feat/genie-enhancements

Conversation

@CheeYuTan
Copy link
Contributor

Summary

Consolidates PRs #270 and #271 into a single PR — both enhance Genie Space MCP tools.

Changes:

File Change Source PR
genie.py Add serialized_space param to create_or_update_genie and get_genie #270
genie.py Add clone_genie tool — export/import full space config #270
genie.py Add manage_genie_instructions tool — list, add text/SQL/batch instructions #271
manager.py Support include_serialized_space in genie_get and serialized_space in genie_create/genie_update #270
auth.py, test_sql.py Fix pre-existing ruff format issues

New tools:

clone_genie(source_space_id, new_display_name, warehouse_id?, description?)
Exports a Genie Space's full configuration (settings, instructions, sample questions) and creates a new space from it. Useful for promoting across environments or creating team variants.

manage_genie_instructions(space_id, action, ...)
Manage instructions that guide Genie's SQL generation:

  • list — list all instructions
  • add_text — add a text instruction/note
  • add_sql — add a SQL query example
  • add_sql_function — add a certified SQL function
  • add_batch — add multiple SQL instructions at once

Test plan

  • ruff check passes
  • ruff format --check passes
  • clone_genie correctly calls genie_get with include_serialized_space=True then genie_create with the exported config
  • manage_genie_instructions dispatches all 5 actions correctly with proper error handling
  • No conflict markers remain in resolved merge

- genie_get: add include_serialized_space param to export full config
- genie_create/genie_update: accept serialized_space for import
- New clone_genie MCP tool for one-step space cloning
- Core library (AgentBricksManager) updated to pass serialized_space
  through the /api/2.0/data-rooms REST API

Fixes databricks-solutions#83
Exposes the existing core library instruction management capabilities
as an MCP tool. Supports listing, adding text instructions, SQL query
examples, SQL functions, and batch operations.

The core library already had genie_list_instructions,
genie_add_text_instruction, genie_add_sql_instruction, etc. but
these were not accessible via MCP tools.
@MigQ2
Copy link
Contributor

MigQ2 commented Mar 10, 2026

@CheeYuTan have you taken a look at #233 ? Looks quite similar to this, would be great to unify both.

I also left my two cents in #172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants