Skip to content

fix(mcp): Remove unsupported thumbnail/preview URLs and internal fields from MCP schemas#38109

Merged
Antonio-RiveroMartnez merged 2 commits intoapache:masterfrom
aminghadersohi:amin/remove-thumbnail-url-from-mcp-dashboard
Feb 23, 2026
Merged

fix(mcp): Remove unsupported thumbnail/preview URLs and internal fields from MCP schemas#38109
Antonio-RiveroMartnez merged 2 commits intoapache:masterfrom
aminghadersohi:amin/remove-thumbnail-url-from-mcp-dashboard

Conversation

@aminghadersohi
Copy link
Contributor

Summary

MCP tool responses currently expose several fields that cause issues for AI assistant clients:

  • thumbnail_url on DashboardInfo — This is an internal API endpoint (/api/v1/dashboard/{id}/thumbnail/...) that returns JSON metadata, not a viewable image. AI chatbots present it as a clickable "Preview Image" link, which shows raw JSON when clicked, confusing users.

  • form_data and query_context on ChartInfo — These are internal technical fields containing raw chart configuration JSON. They bloat responses and cause chatbots to display unnecessary technical details to users.

  • preview_url backward-compat field on ChartPreview — URL-based screenshot previews are not supported (URLPreviewStrategy already returns an error), so this field was dead code that could mislead AI clients.

  • get_chart_info docstring misleadingly described the url field as a "screenshot URL" when it actually links to the chart's explore page.

Changes

  1. Remove thumbnail_url from DashboardInfo schema and both serializer functions
  2. Remove form_data and query_context from ChartInfo schema and serializer
  3. Remove preview_url backward-compat field from ChartPreview and dead URL preview code path in get_chart_preview
  4. Fix get_chart_info docstring and ChartInfo.url field description

Test plan

  • All 505 MCP unit tests pass
  • Verified thumbnail_url no longer appears in dashboard info responses
  • Verified form_data/query_context no longer appear in chart info responses
  • Verified chart preview no longer includes dead URL preview code path

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 20, 2026

Code Review Agent Run #33d28a

Actionable Suggestions - 0
Additional Suggestions - 12
  • tests/unit_tests/mcp_service/chart/tool/test_get_chart_preview.py - 12
    • Linting Violation: Pytest Mark Style · Line 148-148
      The addition of parentheses to @pytest.mark.asyncio() violates Ruff's PT023 rule, which enforces removal of unnecessary parentheses for argument-free pytest markers. This will cause pre-commit to fail. Revert to @pytest.mark.asyncio.
    • Linting Violation: Pytest Mark Style · Line 175-175
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 183-183
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 198-198
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 221-221
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 243-243
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 272-272
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 294-294
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 316-316
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 330-330
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 344-344
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
    • Linting Violation: Pytest Mark Style · Line 366-366
      Same as above: parentheses on @pytest.mark.asyncio() trigger PT023 violation.
Review Details
  • Files reviewed - 6 · Commit Range: 50c300f..50c300f
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/chart/tool/get_chart_info.py
    • superset/mcp_service/chart/tool/get_chart_preview.py
    • superset/mcp_service/dashboard/schemas.py
    • tests/unit_tests/mcp_service/chart/tool/test_get_chart_preview.py
    • tests/unit_tests/mcp_service/chart/tool/test_list_charts.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

@dosubot dosubot bot added the api Related to the REST API label Feb 20, 2026
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.43%. Comparing base (76d897e) to head (dae2259).
⚠️ Report is 3830 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #38109      +/-   ##
==========================================
+ Coverage   60.48%   66.43%   +5.94%     
==========================================
  Files        1931      670    -1261     
  Lines       76236    51445   -24791     
  Branches     8568     5805    -2763     
==========================================
- Hits        46114    34177   -11937     
+ Misses      28017    15873   -12144     
+ Partials     2105     1395     -710     
Flag Coverage Δ
hive 41.42% <ø> (-7.73%) ⬇️
javascript ?
mysql 64.54% <ø> (?)
postgres 64.61% <ø> (?)
presto 41.44% <ø> (-12.36%) ⬇️
python 66.40% <ø> (+2.90%) ⬆️
sqlite 64.21% <ø> (?)
unit 100.00% <ø> (+42.36%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@pull-request-size pull-request-size bot added size/S and removed size/M labels Feb 20, 2026
@github-actions github-actions bot removed the api Related to the REST API label Feb 20, 2026
@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit dae2259
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6998df66bfd45e000895dea2
😎 Deploy Preview https://deploy-preview-38109--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

…ds from MCP schemas

- Remove thumbnail_url from DashboardInfo schema and serializers.
  This field exposed an internal API endpoint that returns JSON
  metadata, not a viewable image. AI chatbots presented it as a
  clickable link, confusing users with raw JSON output.

- Remove form_data and query_context from ChartInfo schema. These
  are internal technical fields not useful for end users or AI
  assistants. They bloat responses and cause chatbots to display
  unnecessary technical information.

- Remove preview_url backward-compat field from ChartPreview.
  URL-based screenshot previews are not supported (URLPreviewStrategy
  already returns an error), so this field was dead code.

- Fix misleading get_chart_info docstring that described the URL
  field as a "screenshot URL" when it links to the explore page.
Remove unnecessary parentheses from @pytest.fixture() and
@pytest.mark.asyncio() decorators to satisfy ruff linting rules.
@aminghadersohi aminghadersohi force-pushed the amin/remove-thumbnail-url-from-mcp-dashboard branch from 21f8e26 to dae2259 Compare February 20, 2026 22:25
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 20, 2026

Code Review Agent Run #2ab1f2

Actionable Suggestions - 0
Review Details
  • Files reviewed - 6 · Commit Range: 5deba07..dae2259
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/chart/tool/get_chart_info.py
    • superset/mcp_service/chart/tool/get_chart_preview.py
    • superset/mcp_service/dashboard/schemas.py
    • tests/unit_tests/mcp_service/chart/tool/test_get_chart_preview.py
    • tests/unit_tests/mcp_service/chart/tool/test_list_charts.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

@Antonio-RiveroMartnez Antonio-RiveroMartnez merged commit 2a3567d into apache:master Feb 23, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants