> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Databricks

> Query Databricks workspace compute, jobs, and SQL warehouses - list clusters and jobs, trigger job runs, and execute SQL statements

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key from `DATABRICKS_TOKEN` is sent as the `Bearer` prefixed `Authorization` header.
* **Docs**: [https://docs.databricks.com/aws/en/dev-tools/auth/pat](https://docs.databricks.com/aws/en/dev-tools/auth/pat)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable           | Required | Description                                                                                                                                            |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `DATABRICKS_TOKEN` | Yes      | Databricks personal access token (generated under Settings > Developer > Access tokens) [Docs](https://docs.databricks.com/aws/en/dev-tools/auth/pat). |
| `DATABRICKS_HOST`  | Yes      | Databricks workspace host, e.g. dbc-a1b2345c-d6e7.cloud.databricks.com or adb-1234567890123456.7.azuredatabricks.net (no protocol)                     |

## Setup

1. **Get a workspace**: If you don't have one, sign up for the Databricks Free Edition at [https://www.databricks.com/learn/free-edition](https://www.databricks.com/learn/free-edition), or use an existing workspace on AWS, Azure, or GCP.
2. **Find your workspace host**: Copy the hostname from your workspace URL, e.g. dbc-a1b2345c-d6e7.cloud.databricks.com (AWS/GCP) or adb-1234567890123456.7.azuredatabricks.net (Azure). Set it as DATABRICKS\_HOST (no https\://).
3. **Generate a personal access token**: In the workspace, click your username > Settings > Developer, click Manage next to Access tokens, then Generate new token. Name it, set a lifetime, and copy the token immediately.
4. **Store the credentials**: Add DATABRICKS\_TOKEN=\<your token> and DATABRICKS\_HOST=\<your workspace host> to your .env file.
5. **Verify access**: Run the List SQL Warehouses tool. A 401/403 means the token is invalid or expired, or token-based auth is disabled by your workspace admin.

* Personal access tokens are workspace-scoped - the token only works against the workspace host where it was created
* Executing SQL requires a running (or auto-starting) SQL warehouse; the first query may take a minute while the warehouse starts
* Databricks recommends OAuth over PATs for production use; PATs are the simplest option for getting started
* Tokens can expire - if calls suddenly return 403, regenerate the token

Provider API reference: [https://docs.databricks.com/api/workspace/introduction](https://docs.databricks.com/api/workspace/introduction)

## Tools

| Tool                  | Access | Description                                                                                                                |
| --------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| List Clusters         | Read   | List all-purpose and job compute clusters in the workspace with their state and configuration                              |
| List Jobs             | Read   | List jobs defined in the workspace, optionally filtered by name                                                            |
| Run Job Now           | Write  | Trigger an immediate run of an existing job, optionally overriding job parameters                                          |
| List Job Runs         | Read   | List recent job runs, optionally filtered to one job or to active/completed runs                                           |
| Cancel Job Run        | Write  | Cancel a job run; the cancellation happens asynchronously, so the run may still be running briefly                         |
| Get Job Run           | Read   | Get the status, timing, and task results of a job run (use the run\_id returned by Run Job Now)                            |
| Execute SQL Statement | Write  | Execute a SQL query against a SQL warehouse and return the result rows (queries; the warehouse enforces table permissions) |
| Get SQL Statement     | Read   | Poll the status and result of a previously submitted SQL statement, e.g. after an async or timed-out execution             |
| List SQL Warehouses   | Read   | List SQL warehouses in the workspace to find a warehouse\_id for executing SQL statements                                  |

## Example prompts

* List my Databricks SQL warehouses, then run a SQL query I provide against one of them and summarize the results.
* List my Databricks jobs and check the status of their most recent runs.
* Show me the clusters in my Databricks workspace and which ones are currently running.
