-
Notifications
You must be signed in to change notification settings - Fork 117
Experimental aitools: improve discoverability, tool registration, warehouse lookup #3946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+110
−20
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Track the upstream source of CLI invocations from the aitools MCP server by setting DATABRICKS_CLI_UPSTREAM=aitools when invoking databricks commands. This required adding WithEnv() method to libs/exec.Executor to support custom environment variables.
Make the init_project, add_project_resource, and analyze_project tools more discoverable by adding MANDATORY prefix to their descriptions. This emphasizes to AI agents that these are the primary tools for working with Databricks projects.
The 'claude mcp add' command defaults to --scope local which installs the MCP server only for the current project directory. This caused the aitools server to be unavailable in other projects. Changed to explicitly use --scope user to install globally, making the MCP server available in all projects. Also made installation reentrant by ignoring 'already exists' errors.
Clarify that Statement Execution API works synchronously for fast queries on running warehouses, but requires polling when warehouse is starting or query takes > 50 seconds. Added clear instructions for handling both SUCCEEDED and PENDING responses, with polling pattern for async queries. Kept guidance concise for context efficiency.
Problem: AI agents in plan mode weren't using init_project and add_project_resource tools. They'd manually create databricks.yml files instead, missing templates and best practices.
Root cause: Tools spoke in execution language ("Use this to create...") but plan mode requires planning language ("Include this when planning..."). The explore tool also had narrow triggers ("when user mentions workspace name").
Solution:
- Broaden explore description: "REQUIRED DURING PLAN MODE" for ANY Databricks work
- Enhance explore output with workflow patterns and keyword matching
- Add "📋 DURING PLAN MODE:" sections to tool descriptions with customer-facing triggers
- Use customer language: "Databricks project/app/pipeline" not "DAB/Asset Bundle"
Pattern matching now maps task language to tools:
- "new project" → init_project
- "SQL pipeline" → add_project_resource type='pipeline'
- "deploy to dev and prod" → init_project (multi-environment setup)
Zero-cost solution: Static guidance presented at natural checkpoints, no agent calls needed.
pietern
reviewed
Nov 18, 2025
Collaborator
|
Commit: 2f4e9d1
14 failing tests:
Top 35 slowest tests (at least 2 minutes):
|
This reverts commit 28b691f.
…tion The check was defensive but not needed - if mcp add fails, it should fail with a clear error message rather than being silently ignored.
The explore tool now gracefully handles warehouse lookup failures by: - Continuing with nil warehouse instead of failing completely - Conditionally displaying warehouse info in template - Using placeholder in SQL examples when warehouse unavailable Also removes unused strings import from claude.go. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
fjakobs
approved these changes
Nov 18, 2025
Contributor
fjakobs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuff
Collaborator
|
Commit: 837bbcf
23 failing tests:
Top 50 slowest tests (at least 2 minutes):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This adds a few improvements to the experimental aitools:
Tests