At a glance
- Availability: Experimental (how to enable).
- Auth: API key.
- Connection: The key from
DATABRICKS_TOKENis sent as theBearerprefixedAuthorizationheader. - Docs: https://docs.databricks.com/aws/en/dev-tools/auth/pat
Credentials
Set these per environment. See Connect an integration.| Variable | Required | Description |
|---|---|---|
DATABRICKS_TOKEN | Yes | Databricks personal access token (generated under Settings > Developer > Access tokens) Docs. |
DATABRICKS_HOST | Yes | Databricks workspace host, e.g. dbc-a1b2345c-d6e7.cloud.databricks.com or adb-1234567890123456.7.azuredatabricks.net (no protocol) |
Setup
- Get a workspace: If you don’t have one, sign up for the Databricks Free Edition at https://www.databricks.com/learn/free-edition, or use an existing workspace on AWS, Azure, or GCP.
- 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://).
- 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.
- Store the credentials: Add DATABRICKS_TOKEN=<your token> and DATABRICKS_HOST=<your workspace host> to your .env file.
- 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
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.