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

   ### SUMMARY
   
   Adds two new MCP tools for the Alerts & Reports domain:
   
   - **`list_reports`**: List alert and report schedules with filtering (by 
name, type, active, dashboard_id, chart_id), text search, sorting, 
select_columns, and 1-based pagination. Supports `owned_by_me` and 
`created_by_me` flags to filter by ownership/creator.
   - **`get_report_info`**: Fetch a single report/alert schedule by numeric ID, 
returning schedule configuration including type (Alert/Report), active status, 
cron expression, and associated dashboard or chart.
   
   Schema discovery is wired in via `get_schema(model_type="report")`.
   
   Key design decisions:
   - RBAC handled automatically via `ReportScheduleDAO.base_filter = 
ReportScheduleFilter`
   - `owners` field stripped by `USER_DIRECTORY_FIELDS` privacy controls
   - No UUID support (ReportSchedule has no UUID column) — integer ID only
   - Column constants and `get_report_columns()` live in `schema_discovery.py` 
for DRY access across list/schema tools
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — backend-only MCP tools.
   
   ### TESTING INSTRUCTIONS
   
   1. Start Superset with MCP service enabled
   2. Connect an MCP client and call `list_reports` — verify it returns reports 
accessible to the current user
   3. Call `list_reports` with `{"owned_by_me": true}` — verify only owned 
reports are returned
   4. Call `get_report_info` with a valid report ID — verify schedule config is 
returned
   5. Call `get_report_info` with an invalid ID — verify a not_found error is 
returned
   6. Call `get_schema(model_type="report")` — verify column/filter metadata is 
returned
   
   Unit tests:
   ```
   pytest tests/unit_tests/mcp_service/report/
   ```
   
   ### 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]

Reply via email to