fix(mcp): include embedded_uuid in get_dashboard_info response#41195
fix(mcp): include embedded_uuid in get_dashboard_info response#41195onurtashan wants to merge 6 commits into
Conversation
Code Review Agent Run #95008aActionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41195 +/- ##
==========================================
- Coverage 64.35% 64.33% -0.03%
==========================================
Files 2651 2651
Lines 144804 144778 -26
Branches 33413 33403 -10
==========================================
- Hits 93187 93136 -51
- Misses 49947 49972 +25
Partials 1670 1670
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adds embedded_uuid to DashboardInfo so agents can retrieve the embedded UUID without a separate API call. The embedded UUID is required for guest token generation (resources[].id) and differs from the dashboard UUID — using the wrong one causes 403 errors in has_guest_access().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two tests were missing `dashboard.embedded = []` in their mock setup, causing `dashboard_serializer` to access `dashboard.embedded[0]` on an unset Mock attribute (truthy but not subscriptable). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a5f804c to
5bf5849
Compare
embedded_uuid was populated in dashboard_serializer and defined as a field on DashboardInfo, but missing from DEFAULT_GET_DASHBOARD_INFO_COLUMNS. Since get_dashboard_info calls model_dump with select_columns defaulting to DEFAULT_GET_DASHBOARD_INFO_COLUMNS, the field was always filtered out of the returned dict even when the dashboard had an embedded UUID.
Code Review Agent Run #1e01a8Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Summary
get_dashboard_inforeturns the internal dashboarduuidbut not the embedded UUID — a separate field required for guest token generation in embedded dashboard workflows.The problem: When using the Superset MCP to build embedded dashboards, agents need the embedded UUID to generate guest tokens. The guest token payload requires
resources[].idto be the embedded UUID (fromGET /api/v1/dashboard/{id}/embedded), not the dashboard UUID. Using the wrong one causes 403 errors inhas_guest_access().Before this fix: agents had to leave the MCP and call the REST API directly to get the embedded UUID, or navigate to the Superset UI (Edit Dashboard → Embed).
After this fix:
get_dashboard_inforeturnsembedded_uuidalongsideuuid.nullwhen the dashboard has not been configured for embedding.Changes
superset/mcp_service/dashboard/schemas.py: addsembedded_uuid: str | NonetoDashboardInfowith a description clarifying the difference fromuuidand when to use itsuperset/mcp_service/dashboard/tool/get_dashboard_info.py: addssubqueryload(Dashboard.embedded)to eager options to avoid an N+1 querytests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py: two new tests (embedded UUID present / absent) +dashboard.embedded = []added to all existing mock dashboardsTest plan
test_get_dashboard_info_includes_embedded_uuid— verifiesembedded_uuidis returned when the dashboard has been configured for embeddingtest_get_dashboard_info_embedded_uuid_none_when_not_embedded— verifiesembedded_uuidisNonefor dashboards not configured for embeddingget_dashboard_infotests pass unchanged