aminghadersohi opened a new pull request, #43828:
URL: https://github.com/apache/superset/pull/43828
### SUMMARY
Superset's MCP compatibility middleware removed `outputSchema` during tool
discovery and `structuredContent` from successful calls. That left clients
without machine-readable result contracts even though native tools have typed
return annotations.
This change:
- advertises concrete `outputSchema` metadata for all 70 native MCP tools,
derived from their validation shapes so custom Pydantic serializers do not
collapse the schemas to unconstrained objects;
- preserves matching `structuredContent` on successful tool calls while
retaining the middleware's sanitized last-resort error boundary;
- gives previously generic chart preview, chart schema, chart info,
dashboard info, and dataset info responses concrete return contracts; and
- adds an exhaustive inventory test that locks the native tool set, exact
read-only/destructive classifications, closed-world hints, mutating-tool
idempotency hints, and a response-specific output field for every schema.
Extension tools retain FastMCP's default schema derivation behavior.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable; this changes the MCP protocol metadata and result envelope,
not the UI.
### TESTING INSTRUCTIONS
```bash
PYTHONPATH="$PWD/superset-core/src" pytest -q \
tests/unit_tests/mcp_service/test_mcp_tool_registration.py \
tests/unit_tests/mcp_service/test_mcp_e2e_smoke.py \
tests/unit_tests/mcp_service/test_middleware.py \
tests/unit_tests/mcp_service/chart/tool/test_update_chart_preview.py
PYTHONPATH="$PWD/superset-core/src" pytest -q tests/unit_tests/mcp_service
git add .
pre-commit run
```
The focused suite passes 165 tests, the full MCP unit suite passes 3,700
tests, and all staged pre-commit hooks pass. The real ASGI smoke test also
verifies that every listed tool carries `outputSchema` and that a successful
health call returns matching `structuredContent`.
### 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]