gabotorresruiz opened a new pull request, #44113:
URL: https://github.com/apache/superset/pull/44113

   ### SUMMARY
   
   Adds a new MCP tool `get_dashboard_data` that returns compact, filter-aware 
data across a dashboard's charts in a single call, so an AI agent can answer 
analytical questions about a whole dashboard without fetching each chart 
separately.
   
   - Selects the dashboard's charts in layout reading order, so a bounded 
selection covers the most prominent charts first.
   - Reuses `get_chart_data`'s query and guest-authorization path: its body is 
extracted into a shared, undecorated `execute_chart_data`, and `get_chart_data` 
becomes a thin wrapper (behavior unchanged).
   - Applies active dashboard filters per chart via `applied_filters` (keyed by 
chart id), so answers reflect the filtered view.
   - Returns a compact per-chart view: column names, a few sample rows, and row 
counts. Bounded by `max_charts` plus a soft time budget so a large or slow 
dashboard degrades gracefully instead of stalling; per-chart errors are 
surfaced, not fatal.
   - Guest-safe: built only on the `ChartDataCommand` path (no raw SQL), with 
`raise_for_access` intact on both dashboard resolution and each chart query, 
and added to `MCP_GUEST_ALLOWED_TOOLS`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (MCP tool, no UI).
   
   ### TESTING INSTRUCTIONS
   
   - `pytest 
tests/unit_tests/mcp_service/dashboard/tool/test_get_dashboard_data.py`
   - Via an MCP client: `get_dashboard_data(request={"identifier": <dashboard 
id>})` returns per-chart columns, sample rows, and counts in layout order, 
bounded by `max_charts`.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in SIP-59)
   - [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]

Reply via email to