Skip to content

Commit 5f65ee3

Browse files
keugenekclaudelennartkats-db
authored
Fixes of scaffolding instructions (#4215)
Summary - Update databricks_discover tool description to emphasize it must be called first - Update flow.tmpl with explicit scaffolding workflow rules Changes provider.go: - databricks_discover description now says "CALL THIS FIRST" and explains it returns scaffolding commands flow.tmpl: - Added "Critical Workflow Rules" section - Rule: "NEVER use npm/npx/vite directly - init-template creates proper Databricks bundle" - Reordered tools to put databricks_discover first with "MUST call first" note Why AI agents were defaulting to npm/vite for scaffolding instead of using invoke_databricks_cli with init-template. These prompt improvements guide agents to call databricks_discover first, which returns the correct scaffolding workflow. --------- Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: Lennart Kats (databricks) <[email protected]>
1 parent 6b9afd5 commit 5f65ee3

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

experimental/apps-mcp/lib/prompts/flow.tmpl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
*/ -}}
77

88
## Databricks MCP Available Tools
9-
- **databricks_discover**: Discover workspace resources and get workflow recommendations
9+
- **databricks_discover**: MUST call first - returns scaffolding commands
10+
- **invoke_databricks_cli**: Execute CLI commands including init-template for scaffolding
1011
- **databricks_configure_auth**: Switch workspace profile/host
11-
- **invoke_databricks_cli**: Execute any Databricks CLI command
1212

13-
## Workflow Best Practices
14-
- Use `databricks_discover` at the beginning of your session to get context-aware recommendations
15-
- For operations affecting live environments, ask for confirmation
16-
- Always validate before deploying
17-
- When not sure about the user's intent, ask clarifying questions
13+
## Critical Workflow Rules
14+
1. ALWAYS call databricks_discover FIRST to get scaffolding guidance
15+
2. For new apps: use invoke_databricks_cli with init-template (see below)
16+
3. For scaffolding: NEVER use `npm create vite` or `npx create-vite` - init-template creates proper Databricks bundle
17+
4. For development: `npm run dev`, `npm install`, `npm run build` are OK after scaffolding
18+
5. Validate before deploying
19+
6. Ask for confirmation on live environment changes
1820

1921
{{.WorkspaceInfo}}{{if .WarehouseName}}
2022
Default SQL Warehouse: {{.WarehouseName}} ({{.WarehouseID}}){{else}}

experimental/apps-mcp/lib/providers/clitools/provider.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ func (p *Provider) RegisterTools(server *mcpsdk.Server) error {
9292

9393
mcpsdk.AddTool(server,
9494
&mcpsdk.Tool{
95-
Name: "databricks_discover",
96-
Description: "Discover available Databricks workspaces, warehouses, and get workflow recommendations. Call this FIRST when planning ANY Databricks work involving apps, dashboards, pipelines, jobs, bundles, or SQL workflows. Returns workspace capabilities and recommended tooling.",
95+
Name: "databricks_discover",
96+
Description: `CALL THIS FIRST before any Databricks work. Returns essential scaffolding commands, workflow guidance, and guidance on writing and editing Databricks source code.
97+
98+
This tool provides context needed for scaffolding new projects, editing existing code, deploying bundles, and querying data. Without calling this first, you won't know the correct CLI patterns or workspace configuration.`,
9799
},
98100
func(ctx context.Context, req *mcpsdk.CallToolRequest, args DiscoverInput) (*mcpsdk.CallToolResult, any, error) {
99101
log.Debugf(ctx, "databricks_discover called: working_directory=%s", args.WorkingDirectory)

0 commit comments

Comments
 (0)