Skip to content

fix(mcp): include embedded_uuid in get_dashboard_info response#41195

Open
onurtashan wants to merge 6 commits into
apache:masterfrom
onurtashan:fix/mcp-get-dashboard-info-embedded-uuid
Open

fix(mcp): include embedded_uuid in get_dashboard_info response#41195
onurtashan wants to merge 6 commits into
apache:masterfrom
onurtashan:fix/mcp-get-dashboard-info-embedded-uuid

Conversation

@onurtashan

@onurtashan onurtashan commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

get_dashboard_info returns the internal dashboard uuid but 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[].id to be the embedded UUID (from GET /api/v1/dashboard/{id}/embedded), not the dashboard UUID. Using the wrong one causes 403 errors in has_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_info returns embedded_uuid alongside uuid. null when the dashboard has not been configured for embedding.

Changes

  • superset/mcp_service/dashboard/schemas.py: adds embedded_uuid: str | None to DashboardInfo with a description clarifying the difference from uuid and when to use it
  • superset/mcp_service/dashboard/tool/get_dashboard_info.py: adds subqueryload(Dashboard.embedded) to eager options to avoid an N+1 query
  • tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py: two new tests (embedded UUID present / absent) + dashboard.embedded = [] added to all existing mock dashboards

Test plan

  • test_get_dashboard_info_includes_embedded_uuid — verifies embedded_uuid is returned when the dashboard has been configured for embedding
  • test_get_dashboard_info_embedded_uuid_none_when_not_embedded — verifies embedded_uuid is None for dashboards not configured for embedding
  • Existing get_dashboard_info tests pass unchanged

@dosubot dosubot Bot added api:dashboard Related to the REST endpoints of the Dashboard embedded labels Jun 18, 2026
@bito-code-review

bito-code-review Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #95008a

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/mcp_service/dashboard/schemas.py - 2
Review Details
  • Files reviewed - 3 · Commit Range: d75cbb3..d75cbb3
    • superset/mcp_service/dashboard/schemas.py
    • superset/mcp_service/dashboard/tool/get_dashboard_info.py
    • tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@netlify

netlify Bot commented Jun 18, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 82991ab
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a3449afd8b7c300088912a7
😎 Deploy Preview https://deploy-preview-41195--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.33%. Comparing base (4053f53) to head (82991ab).

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              
Flag Coverage Δ
hive 39.32% <100.00%> (+<0.01%) ⬆️
mysql 58.05% <100.00%> (+<0.01%) ⬆️
postgres 58.12% <100.00%> (+<0.01%) ⬆️
presto 40.91% <100.00%> (+<0.01%) ⬆️
python 59.56% <100.00%> (+<0.01%) ⬆️
sqlite 57.78% <100.00%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot removed the embedded label Jun 18, 2026
onurtashan and others added 3 commits June 18, 2026 15:28
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>
@onurtashan onurtashan force-pushed the fix/mcp-get-dashboard-info-embedded-uuid branch from a5f804c to 5bf5849 Compare June 18, 2026 12:30
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.
@bito-code-review

bito-code-review Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #1e01a8

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 4c9dc89..8badd8c
    • superset/mcp_service/dashboard/schemas.py
    • superset/mcp_service/dashboard/tool/get_dashboard_info.py
    • tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api:dashboard Related to the REST endpoints of the Dashboard size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant