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

   ### SUMMARY
   Replaces the untyped `Dict[str, Any]` return value of the MCP 
`generate_explore_link` tool with typed Pydantic response schemas, introducing 
two new models in `superset/mcp_service/explore/schemas.py`:
   
   - **`GenerateExploreLinkResponse`** — adds an explicit `success` field 
alongside `url`, `form_data`, `form_data_key`, and `error`, so callers no 
longer have to infer success from the absence of an error.
   - **`ExploreLinkError`** — structured error model with a machine-readable 
`error_type` discriminant (`dataset_not_found`, `generation_failed`, 
`permission_denied`), letting callers branch on failure mode without parsing 
free-text error messages.
   
   The tool itself (`generate_explore_link.py`) now returns 
`GenerateExploreLinkResponse`. Tests were updated to use 
`result.structured_content`, which is the correct accessor when FastMCP tools 
return Pydantic models instead of plain dicts.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A — backend/MCP-only change, no UI surface.
   
   ### TESTING INSTRUCTIONS
   1. Run the unit tests for the tool:
      ```
      pytest superset/mcp_service/explore/tool/test_generate_explore_link.py -v
      ```
   2. Manually invoke the MCP `generate_explore_link` tool against a valid 
dataset and confirm the response is a structured object with `success: true` 
and a populated `url`.
   3. Invoke against an invalid dataset id and confirm the response includes 
`success: false` and an `ExploreLinkError` with `error_type: 
"dataset_not_found"`.
   
   ### 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
   - [ ] 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