> This page is for Agent Handler.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Databricks

**Authentication:** OAuth or personal access token. See [Magic Link](/merge-agent-handler/features/magic-link) for the runtime auth flow, or [Application credentials](/merge-agent-handler/admin-setup/add-oauth-credentials) to bring your own OAuth app.

## Sample use cases

* List the 10 most recent failed jobs in the `prod` workspace and surface the error.
* Run the `nightly_etl` job and notify #data-eng when it finishes.
* Show me clusters with idle time >2 hours so we can shut them down.

## Available Tools

#### list\_clusters

List all clusters in the Databricks workspace. Returns cluster IDs, names, states, and configurations. Use this to find cluster IDs for other operations.

#### get\_cluster

Get detailed information about a specific Databricks cluster including state, configuration, and resource allocation. Use list\_clusters first to find the cluster ID.

#### create\_cluster

Create a new Databricks cluster. Requires cluster name, Spark version, and node type. Specify num\_workers for fixed size or autoscale\_min/max\_workers for autoscaling.

#### start\_cluster

Start a terminated Databricks cluster. The cluster must be in TERMINATED state. Use list\_clusters to find clusters and their states.

#### terminate\_cluster

Terminate a running Databricks cluster. This stops the cluster but preserves its configuration for restarting. Use list\_clusters to find cluster IDs.

#### list\_jobs

List jobs in the Databricks workspace with optional name filter and pagination. Returns job IDs, names, and settings. Use page\_token from response for next page.

#### get\_job

Get detailed information about a specific Databricks job including tasks, schedule, and configuration. Use list\_jobs first to find the job ID.

#### create\_job

Create a new Databricks job with one or more tasks. Each task needs a task\_key and type (notebook\_task, spark\_python\_task, sql\_task, etc). Supports scheduling with cron expressions.

#### delete\_job

Permanently delete a Databricks job. This also cancels any active runs. Use list\_jobs to find the job ID.

#### run\_job\_now

Trigger an immediate run of a Databricks job. Optionally pass notebook\_params or python\_named\_params to override defaults. Use list\_jobs to find the job ID.

#### list\_job\_runs

List job runs in the Databricks workspace. Filter by job\_id, active\_only, or completed\_only. Supports offset/limit pagination. Returns run IDs, states, and timing info.

#### get\_job\_run

Get detailed information about a specific job run including state, timing, and task details. Use list\_job\_runs to find the run ID.

#### cancel\_job\_run

Cancel an active job run. The run must be in PENDING or RUNNING state. Use list\_job\_runs with active\_only=true to find cancellable runs.

#### get\_job\_run\_output

Get the output of a completed job run including notebook results, SQL output, logs, and error traces. Use list\_job\_runs to find the run ID.

#### execute\_sql\_statement

Execute a SQL statement on a Databricks SQL warehouse. Returns results synchronously within wait\_timeout (default 10s) or a statement\_id for async polling via get\_sql\_statement.

#### get\_sql\_statement

Get the status and results of a SQL statement execution. Use this to poll for results of async statements started with execute\_sql\_statement.

#### cancel\_sql\_statement

Cancel a running SQL statement execution. Use get\_sql\_statement first to verify the statement is still in PENDING or RUNNING state.

#### list\_sql\_warehouses

List all SQL warehouses in the Databricks workspace. Returns warehouse IDs, names, sizes, and states. Use this to find warehouse IDs for SQL execution.

#### get\_sql\_warehouse

Get detailed information about a specific SQL warehouse including state, size, cluster count, and active sessions. Use list\_sql\_warehouses to find the warehouse ID.

#### create\_sql\_warehouse

Create a new Databricks SQL warehouse. Requires a name and cluster\_size (T-shirt sizing from 2X-Small to 4X-Large). Optionally configure autoscaling and auto-stop.

#### start\_sql\_warehouse

Start a stopped SQL warehouse. The warehouse must be in STOPPED state. Use list\_sql\_warehouses to find warehouses and their states.

#### stop\_sql\_warehouse

Stop a running SQL warehouse. This deallocates compute resources. Use list\_sql\_warehouses to find warehouses and their states.

#### list\_workspace

List objects in a Databricks workspace directory. Returns notebooks, directories, files, repos, and libraries at the given path. Use '/' for the root directory.

#### get\_workspace\_object\_status

Get metadata about a workspace object including type, language (for notebooks), and timestamps. Use list\_workspace to find valid paths.

#### delete\_workspace\_object

Delete a workspace object (notebook, file, or directory). For non-empty directories, set recursive=true. Use list\_workspace to find valid paths.

#### ask\_genie

Ask a natural language question about your data using Databricks Genie. Provide either space\_id or space\_name to identify the Genie room.

#### create\_vector\_search\_endpoint

Create a vector search endpoint to host vector search indexes. An endpoint must exist before creating indexes on it.

#### create\_vector\_search\_index

Create a vector search index on an endpoint. Use DELTA\_SYNC to auto-sync from a Delta table, or DIRECT\_ACCESS for manual vector upserts.

#### delete\_vector\_search\_endpoint

Delete a vector search endpoint. All indexes on the endpoint must be deleted first.

#### delete\_vector\_search\_index

Delete a vector search index. This permanently removes the index and its data. Use query\_vector\_index to verify the index before deleting.

#### execute\_sql\_statement\_readonly

Execute a read-only SQL statement on a Databricks SQL warehouse (SELECT, WITH, SHOW, DESCRIBE, EXPLAIN, VALUES, LIST).

#### export\_notebook

Export a notebook's content from the workspace. Returns base64-encoded content in the specified format (SOURCE, HTML, JUPYTER, DBC).

#### get\_cluster\_events

Get events for a cluster to diagnose issues. Returns creation, termination, resizing, errors, and driver events. Filter by time range or event type.

#### get\_current\_user

Get the current authenticated Databricks user and their workspace home directory. Returns user ID, username, display name, and home path (e.g.

#### get\_genie\_message

Get the status and results of a Genie message. Use this to poll for results when ask\_genie returns status EXECUTING\_QUERY.

#### get\_table\_info

Get detailed information about a table including column definitions, types, and properties. Provide the full three-level name (catalog.schema.table).

#### import\_notebook

Create or overwrite a notebook in the workspace. Content must be base64-encoded. For SOURCE format, specify the language (PYTHON, SCALA, SQL, R).

#### list\_catalogs

List all catalogs in Unity Catalog. Returns catalog names, owners, types, and descriptions.

#### list\_genie\_spaces

List available Genie spaces (rooms). Returns space IDs, names, and descriptions. Use this to find a space before asking questions with ask\_genie.

#### list\_schemas

List schemas within a Unity Catalog catalog. Returns schema names, owners, and descriptions. Use list\_catalogs first to find valid catalog names.

#### list\_serving\_endpoints

List all model serving endpoints in the workspace. Returns endpoint names, states, served models, and configuration.

#### list\_tables

List tables within a Unity Catalog schema. Returns table names, types, formats, and owners.

#### query\_serving\_endpoint

Query a model serving endpoint for predictions or chat completions. Automatically detects Foundation Model API endpoints (chat, completions, embedding…

#### query\_vector\_index

Query a vector search index using text or a vector. Returns the most similar documents with scores. Supports filtering and column selection.

#### rename\_workspace\_file

Rename or move a workspace file or notebook to a new path. Returns destination\_url for the new location.

#### repair\_run

Re-run failed tasks in a completed job run without re-running succeeded ones. Set rerun\_all\_failed\_tasks=true to retry all failures, or specify indivi…

#### run\_notebook

Submit a one-time notebook run. Requires either warehouse\_id (SQL warehouse) or existing\_cluster\_id (cluster) for compute.