Skip to content

Add consolidated manage_secrets tool (scopes and secrets CRUD)#417

Closed
jralfonsog wants to merge 8 commits intodatabricks-solutions:mainfrom
jralfonsog:feat/secrets-management
Closed

Add consolidated manage_secrets tool (scopes and secrets CRUD)#417
jralfonsog wants to merge 8 commits intodatabricks-solutions:mainfrom
jralfonsog:feat/secrets-management

Conversation

@jralfonsog
Copy link
Copy Markdown

@jralfonsog jralfonsog commented Apr 2, 2026

Summary

  • New consolidated MCP tool: manage_secrets(action=...) — 7 actions for managing secret scopes and secrets
  • Skill update: Updated databricks-secrets skill with consolidated tool examples

Tool consolidation

Action What it does
create_scope Create a new secret scope
list_scopes List all secret scopes
delete_scope Delete a scope and all its secrets
put Create or update a secret (string or bytes)
get Retrieve a secret value
list List secrets in a scope
delete Delete a secret

Includes manifest tracking (track_resource/remove_resource) on scope create/delete.

Test plan

  • 25 unit tests — all passing
  • Ruff lint + format pass
  • Integration test on aws-fe: create scope, put/list/delete secrets, delete scope

This pull request was AI-assisted by Isaac.

Scope CRUD (create, list, delete) and secret operations (put, get,
list, delete). get_secret defaults to metadata-only (exists + byte
length) to prevent leaking values into LLM context. Full value
retrieval is opt-in via return_value=True for programmatic use only.

Co-authored-by: Isaac
7 tools: create/list/delete scopes, put/get/list/delete secrets.
get_secret returns metadata only (exists + byte length) — secret
values are never exposed to the LLM. Scope create/delete integrates
with manifest resource tracking.

Co-authored-by: Isaac
Covers create/list/delete scopes, put/get/list/delete secrets,
metadata-only vs full-value get_secret modes, validation errors,
and not-found handling.

Co-authored-by: Isaac
- Docstrings: opening """ on its own line
- MCP module header: add tool listing
- Returns sections: bullet list format for dict keys
- Manifest imports: late imports in try blocks
- Idempotent create: create_secret_scope returns created flag on ResourceAlreadyExists
- MCP tool renamed to create_or_update_secret_scope

Co-authored-by: Isaac
@jralfonsog jralfonsog force-pushed the feat/secrets-management branch from 962cc24 to ea89315 Compare April 6, 2026 09:53
Replace 7 separate MCP tools with a single manage_secrets(action=...) tool
following the consolidation pattern from PR databricks-solutions#394. Actions: create_scope,
list_scopes, delete_scope, put, get, list, delete. Adds manifest tracking
via direct imports instead of lazy imports.

Co-authored-by: Isaac
25 unit tests covering all 7 actions: happy paths, missing required params,
manifest tracking/removal, case insensitivity, and invalid action handling.
Tests call _manage_secrets_impl directly to avoid MCP decorator overhead.

Co-authored-by: Isaac
Replace 7 individual tool references with single manage_secrets(action=...)
table. Update all code examples to use the consolidated tool signature.

Co-authored-by: Isaac
@jralfonsog jralfonsog changed the title Add secrets management tools (scopes and secrets CRUD) Add consolidated manage_secrets tool (scopes and secrets CRUD) Apr 7, 2026
@calreynolds
Copy link
Copy Markdown
Collaborator

Thank you for the contribution! While we don't think this content aligns with what we're looking for at this time — we're actively monitoring tool and skill bloat, and require use of our testing framework for contributions to be merged — we appreciate you opening these PRs! While I can't see your name on GitHub, if you're at Databricks feel free to reach out on Slack. 👍

@calreynolds calreynolds closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants