Genie(Genie One MCPのコマンドラインツール版)を通じて、Databricks のデータを探索・検索・照会します。 次のような場合に使用: - ユーザーがデータの検索や場所を特定したいとき(「Xにはどんなテーブルがあるか」「Xはどこにあるか」「Yはどのカタログやスキーマ(データベース内の整理単位)にあるか」など) - データについて自然言語の質問に答える必要があるとき - SQLクエリ(データベース問い合わせ言語)を作成する必要があるとき
Discover, explore, and query Databricks data via Genie — the CLI equivalent of the Genie One MCP. MUST be invoked whenever the user asks to find or locate data ('what tables are in X', 'where does X live', 'which catalog/schema has Y'), answer a natural-language question about the data, or write a SQL query.
このスキルはデータに関する作業を振り分けます — まず以下を判断してください:
databricks genie ask -s <セッションラベル> "..." (下の「振り分け」を参照)Genie Oneは認証済みのCLIプロファイル(親の databricks-core スキルが認証やプロファイルについて説明しています)さえあれば動作します。ただしデータリクエストはまずGenie Oneに振り分けてください。カタログを手作業で閲覧する迂回路を取らないようにしてください。
リクエストがデータについてのものである場合、Genie Oneに振り分けてください:
あなたのコーディングエージェント(Genie Oneは使用しない)に振り分けてください — その他すべての場合:
.sql ファイル、ノートブック、ダッシュボード、アプリ、設定など。Genie Oneがデータを見つけてSQLを生成します。あなたがファイルを書きますCREATE / INSERT / UPDATE / DELETE基本原則: データ発見、データに関する質問、クエリ生成 → Genie One。その他すべて → あなたのコーディングエージェント。
Genie OneはDatabricksのデータプレーン(データ処理領域)内で実行され、組織のUnity Catalogメタデータ、メトリックビュー、キュレーション済みセマンティックコンテキスト(意味的背景情報)への統制された直接アクセスを持っています。これはあなたがアドホック(その場限りの)SQLでスキーマをリバースエンジニアリングするときにはないコンテキストです。データ質問についてはGenie Oneは自分で発見用SQLを書くよりも高品質で高速なことが多く、管理されたDatabricks機能として継続的に改善されています。できるからといって自分で発見用SQLを書くことを標準としないようにしましょう。
常に -s でセッションラベル(会話の識別名)を渡し、同じものを再利用することを優先してください。フォローアップは最初の問い合わせがセッションラベルを設定した場合のみ会話を続けることができ、それを再利用すると後の質問は今までに聞いたすべてに基づいて行われます(「以上の内容をまとめてください」)。意図的に別の会話を始める場合、または複数を並行実行する場合のみ新しいセッションラベルを使用してください。
コマンドは databricks genie ask (CLI >= v1.9.0)です。より古いCLIではこれは databricks experimental genie ask の下にあります — フラグと動作は同じです。databricks genie ask が見つからない場合はその正確なフォールバックを使用してください。
# 常にセッションラベルを渡し、フォローアップが前の内容に基づくよう同じものを再利用する
databricks genie ask -s trips "先週はいくつの予約があったか?"
databricks genie ask -s trips "目的地別に内訳を出してください"
databricks genie ask -s trips "以上の内容をまとめてください"
# --include-sql はGenieが実行したSQLも表示します(クエリ生成にも使用できます)
databricks genie ask -s trips "収益が高い上位5つの目的地のSQLを書いてください" --include-sql
# --output json で解析可能な結果を取得
databricks genie ask -s trips "収益が高い上位5つの目的地" --output json
# → {"status":"completed","conversation_id":"…","text":"…","tool_calls":[{"name":"execute_sql","sql":"…","title":"…"}]}
# より古いCLI (< v1.9.0) — 廃止予定の別名の下にある同じコマンド:
# databricks experimental genie ask -s trips "先週はいくつの予約があったか?"
Genie Oneはあなたが見ることができるすべてのデータで検索し、SQLを実行し、根拠のある回答をストリーミング配信します — 実行されたSQLでレンダリングされ、必要に応じてターミナルグラフが表示されます。SQLウェアハウスを自動的に解決します(--warehouse-id でオーバーライド可能)。選択したり設定したりする必要はありません。
kill (SIGTERM)はクリーンにキャンセルされますtrips のようなトピック、または シェルごとのセッション用に $$。デフォルトでは1つのセッションラベルを再利用することで、フォローアップが完全なコンテキストを保持するようにしてください。意図的に別の会話のためにのみ新しいものを使用してください。期限切れのセッションラベルは次の問い合わせで新たに始まるだけです。コピーするIDはありません-s q1、-s q2 など)— 独立したセッションラベルは相互に影響しません。単一のセッションラベル内ではコールをシーケンシャル(順序立てて)保ってください。前のターンが返ってきた後にフォローアップを送信し、同じセッションラベルに対して2つの問い合わせを同時に発火しないでください(2つの会話に分かれて、1つのマッピングしか生き残りません)--output json は {status, conversation_id, text, tool_calls[]}を提供します。tool_calls はGenieが実行したSQLを含みます。--raw は生のイベントストリームをダンプします。--output json はバッファリングして最後に1度だけ出力することに注意(ライブストリーミングなし)— 解析に使用し、対話的な使用にはデフォルトのテキスト出力を使用してください--include-sql はGenieが実行したクエリも表示してくれるため — SQLはよく検証されているもので)。Genie Oneはあなたのためにスキーマとジョイン(データ結合)を解決してくれるため、これは不慣れなテーブルに対してSQLを手で書くより優れています--include-sql またはJSON の tool_calls からコピー)を親の ... aitools tools query "<SQL>" に入力してください命名: 「Genie One」はこのクロスデータチャットの現在の名前です — 以前は「Databricks One」、その後「OneChat」(バックエンドツールは依然として文字通り
onechatという名前です)。すべて同じものです。
Genie One が本当に利用できない場合のみフォールバックしてください — まず databricks genie ask --help で確認してください(またはCLIがv1.9.0より古い場合は databricks experimental genie ask --help)。コマンドがないと決めつけないでください。Genie Oneが有効でない場合、CLIがどちらの形式の genie ask にも対応していない場合、またはGenieが質問をカバーできない場合は、親スキルのコマンドで自分で発見を行ってください — マニュアルデータ探索 を参照(information_schema 、discover-schema 、および tools query を使用したキーワード検索)。既知のSQLを実行したり既知のテーブルをプロファイリングするのはその方法で完全に大丈夫です。データ位置の質問に databricks tables list または生のUC REST を標準としないでください — このスキルを呼び出して最初にGenie Oneに聞いてください。
Databricksはこの機能を管理MCPサーバー(Genie One MCP)としても提供しています。このスキルはDatabricks CLIを通じて同じ機能を提供し、設定またはホストするMCPサーバーは不要です。より広くは、Databricks Agent Skillsはダータブリックス管理MCPサーバーと同じ領域をカバーしているため、これを使用するのにMCPを接続する必要はありません。既にGenie One MCPを実行している場合は、どちらでも使用してください — どちらも同じGenieバックエンドにアクセスします。
This skill routes data work — decide first:
databricks genie ask -s <session-label> "..." (see Routing below).Genie One just needs an authenticated CLI profile (the parent databricks-core
skill covers auth/profiles if you need it) — but route the data request to Genie
first; don't detour into manual catalog browsing.
Route to Genie when the request is about the data:
Route to your own coding agent (do NOT use Genie) for everything else:
.sql file, notebook, dashboard, app, config.
Genie finds the data and produces the SQL; you write the file.CREATE / INSERT / UPDATE / DELETE.Key principle: data discovery, data questions, and query generation → Genie One. Everything else → your coding agent.
Genie runs inside the Databricks data plane with governed, first-hand access to the org's Unity Catalog metadata, metric views, and curated semantic context — context you do not have when reverse-engineering schemas with ad-hoc SQL. For data questions it is often higher-quality and more performant than doing the discovery yourself, and it keeps improving as a managed Databricks capability. Don't default to writing your own discovery SQL just because you can.
Always pass a session label with -s, and prefer reusing the same one: a
follow-up can only continue a conversation if the first ask set the session label,
and reusing it lets later questions build on everything asked so far ("summarize all
of the above"). Use a fresh session label only to start a deliberately separate
session, or distinct session labels to run several in parallel.
The command is databricks genie ask (CLI >= v1.9.0). On an older CLI it lives
under databricks experimental genie ask — same flags and behavior; use that
exact fallback if databricks genie ask is not found.
# Always pass a session label, and reuse the SAME one so follow-ups build on each other
databricks genie ask -s trips "How many bookings were there last week?"
databricks genie ask -s trips "Break that down by destination"
databricks genie ask -s trips "Summarize all of the above"
# --include-sql also prints the SQL Genie ran (use it to generate a query, too)
databricks genie ask -s trips "Write SQL for the top 5 destinations by revenue" --include-sql
# --output json gives a parseable result
databricks genie ask -s trips "Top 5 destinations by revenue" --output json
# → {"status":"completed","conversation_id":"…","text":"…","tool_calls":[{"name":"execute_sql","sql":"…","title":"…"}]}
# Older CLI (< v1.9.0) — same command under the deprecated experimental alias:
# databricks experimental genie ask -s trips "How many bookings were there last week?"
Genie searches across all the data you can see, runs SQL, and streams a grounded
answer — rendered with the executed SQL and, where it helps, a terminal chart. It
auto-resolves a SQL warehouse (override with --warehouse-id); nothing to pick or
set up.
kill (SIGTERM) cancels cleanly.trips, or $$ for a
per-shell session. Default to reusing one session label so follow-ups keep full
context; use a fresh one only for a deliberately separate session. An expired
session label just starts fresh on the next ask. No id to copy around.-s q1, -s q2, …) — independent session labels don't interfere. Within a single
session label keep calls sequential: send a follow-up after the previous turn
returns, and never fire two asks at once on the same session label (they'd split
into two conversations and only one mapping would survive).--output json gives {status, conversation_id, text, tool_calls[]}, where tool_calls includes the SQL Genie executed; --raw dumps
the raw event stream. Note --output json buffers and prints once at the end (no
live streaming) — use it for parsing, the default text output for interactive use.--include-sql also shows the query Genie
ran to verify it — so the SQL is known-good). Genie resolves the schema and joins
for you, so this beats hand-writing SQL against unfamiliar tables.--include-sql or the JSON tool_calls) into the
parent's ... aitools tools query "<SQL>".Naming: "Genie One" is the current name for this cross-data chat — formerly "Databricks One", then "OneChat" (the backend tool is still literally named
onechat). All the same thing.
Only fall back if Genie One is genuinely unavailable — first verify with
databricks genie ask --help (or databricks experimental genie ask --help on a
CLI older than v1.9.0); don't assume the command is missing. When Genie One isn't
enabled, the CLI is too old to have either form of genie ask,
or Genie can't cover the question, do the discovery yourself with the parent skill's
commands — see Manual Data Exploration
(keyword search via information_schema, discover-schema, and tools query).
Running known SQL or profiling a known table that way is perfectly fine on its own.
Do not default to databricks tables list or raw UC REST for data-location
questions — invoke this skill and ask Genie first.
Databricks also offers this capability as a managed MCP server — the Genie One MCP. This skill delivers the same functionality through the Databricks CLI, with no MCP server to configure or host. More broadly, the Databricks Agent Skills cover the same ground as Databricks' managed MCP servers, so you don't need any MCP wired up to use this. If you already run the Genie One MCP, use whichever you prefer — they hit the same Genie backend.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。