Skip to content

AI-1166: add delete_config tool (split from #498) - #561

Draft
Matovidlo wants to merge 1 commit into
mainfrom
AI-1166-delete-configuration
Draft

AI-1166: add delete_config tool (split from #498)#561
Matovidlo wants to merge 1 commit into
mainfrom
AI-1166-delete-configuration

Conversation

@Matovidlo

@Matovidlo Matovidlo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

Linear: AI-1166

Change Type

  • Major (breaking changes, significant new features)
  • Minor (new features, enhancements, backward compatible)
  • Patch (bug fixes, small improvements, no new features)

Summary

Split out of #498 per @cjayyy's review — delete is orthogonal to variables and deserves its own review and changelog visibility.

Adds a dedicated delete_config tool for deleting component configurations, addressing all three review concerns:

  1. Dedicated tool instead of a delete=True flag on update_config/update_sql_transformation — the destructiveHint=True, idempotentHint=False annotation now unambiguously means "deletes", and clients can gate this one tool.
  2. Moves to trash instead of skip_trash=True — deletes are recoverable from the Keboola UI (Settings → Trash). No permanent-delete path is exposed.
  3. No cascade deletion — related configurations (e.g. a linked keboola.variables config) are left in place (orphaned) for now; cascade clean-up is deferred until AI-1166: add variables parameter to create/update SQL transformation and config tools #498 lands.

Behavior:

  • Works for root configurations and SQL transformations (no separate transformation delete tool)
  • Flows (keboola.orchestrator, keboola.flow) and data apps are rejected via a new check_deletable() guard with a pointer to their dedicated tools
  • Returns ConfigToolOutput carrying the pre-deletion description/version plus a change summary noting the config can be restored

RFC: feature_spec/delete-config/RFC.md

Note: whether the assistant should be allowed to delete configurations at all (HITL/approval gating) remains an open product decision — this PR keeps the operation recoverable and clearly annotated so that discussion can happen on its own terms.

Testing

  • Tested with Cursor AI desktop (Streamable-HTTP transports)

Optional testing

  • Tested with Cursor AI desktop (all transports)
  • Tested with claude.ai web and canary-orion MCP (Streamable-HTTP)
  • Tested with In Platform Agent on canary-orion
  • Tested with RO chat on canary-orion

Checklist

  • Self-review completed
  • Unit tests added/updated (if applicable)
  • Integration tests added/updated (if applicable) — N/A
  • Project version bumped according to the change type (1.65.0 → 1.66.0)
  • Documentation updated (if applicable) — TOOLS.md regenerated, RFC added

🤖 Generated with Claude Code

Split out of PR #498 per review feedback. Dedicated tool instead of a
delete=True flag on update tools, so the destructive annotation is
unambiguous. Configurations are moved to the trash (recoverable from
the Keboola UI) — skip_trash is not used. SQL transformations are
deletable; flows and data apps are rejected via check_deletable().
Linked configurations (e.g. keboola.variables) are NOT cascade-deleted
and are left orphaned for now.

Includes RFC (feature_spec/delete-config/RFC.md), unit tests, TOOLS.md
regeneration and version bump 1.65.0 -> 1.66.0 (minor, new tool).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear

linear Bot commented Jun 3, 2026

Copy link
Copy Markdown

AI-1166

@Matovidlo

Copy link
Copy Markdown
Contributor Author

@claude review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dedicated delete_config MCP tool to delete (trash) component configurations, split out for clearer destructive semantics and client-side gating.

Changes:

  • Introduces delete_config tool that moves configurations to the project trash (recoverable) and returns pre-deletion metadata.
  • Adds check_deletable() guard to reject flows and data apps, while allowing SQL transformations to be deleted via the same tool.
  • Updates tool registry/docs/tests and bumps project version to 1.66.0.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/keboola_mcp_server/tools/components/tools.py Registers and implements the new delete_config tool.
src/keboola_mcp_server/tools/components/utils.py Adds check_deletable() and undeletable-component message map.
tests/tools/components/test_tools.py Adds unit tests for delete_config and rejection cases.
tests/test_server.py Ensures the tool is listed and annotated/tagged correctly.
TOOLS.md Regenerates tools documentation to include delete_config.
feature_spec/delete-config/RFC.md Adds RFC documenting intended behavior/constraints.
pyproject.toml Version bump to 1.66.0.
uv.lock Lockfile version bump to 1.66.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1580 to +1584
detail = await client.storage_client.configuration_detail(
component_id=component_id, configuration_id=configuration_id
)
await client.storage_client.configuration_delete(component_id=component_id, configuration_id=configuration_id)
LOG.info(f'Deleted configuration "{configuration_id}" of component "{component_id}" (moved to trash).')
Comment on lines +2210 to +2213
# The configuration must go to the trash (recoverable) — skip_trash must not be enabled.
keboola_client.storage_client.configuration_delete.assert_called_once_with(
component_id=component_id, configuration_id=configuration_id
)
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