aminghadersohi opened a new pull request, #40956:
URL: https://github.com/apache/superset/pull/40956
### SUMMARY
Adds a `delete_dashboard` tool to the Superset MCP service. AI agents that
generate test dashboards (e.g. via `generate_dashboard`) previously had no way
to clean them up — this closes that CRUD gap.
Design:
- Params: `dashboard_id` (int) and a **required** `confirm` boolean safety
gate. The tool refuses with a clear error unless `confirm=true` is explicitly
passed, forcing the caller (LLM) to state destructive intent. Single delete
only — no bulk.
- Backed by the existing `DeleteDashboardCommand`, so ownership checks, the
report-schedule guard, and transactional semantics are identical to the REST
API delete path.
- The dashboard is fetched first so the response echoes what was deleted
(id, title, slug) in a structured `DeleteDashboardResponse` with `deleted:
bool` and an `error` field. Title/slug are sanitized before LLM exposure,
matching the other dashboard tools.
- Structured error responses for: not confirmed, not found, forbidden
(`DashboardForbiddenError`), and delete failure (including associated
alerts/reports).
- Tool is tagged `mutate` with `class_permission_name="Dashboard"`,
`method_permission_name="write"`, and MCP annotations `readOnlyHint=False,
destructiveHint=True`.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend MCP tool only, no UI changes.
### TESTING INSTRUCTIONS
1. `pytest
tests/unit_tests/mcp_service/dashboard/tool/test_delete_dashboard.py`
2. Or manually: start the MCP service, call `delete_dashboard` with
`{"dashboard_id": <id>, "confirm": false}` and verify it refuses; retry with
`"confirm": true` and verify the dashboard is deleted and the response echoes
id/title/slug.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [x] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]