michael-s-molina commented on code in PR #36271: URL: https://github.com/apache/superset/pull/36271#discussion_r2561079088
########## superset/mcp_service/chart/tool/generate_chart.py: ########## @@ -51,8 +52,11 @@ @mcp.tool @mcp_auth_hook @parse_request(GenerateChartRequest) +# NOTE: Accept str | GenerateChartRequest to support LLM clients that send double-escaped +# JSON strings instead of native Pydantic types. The @parse_request decorator +# handles conversion, ensuring compatibility with all MCP clients. async def generate_chart( # noqa: C901 - request: GenerateChartRequest, ctx: Context + request: str | GenerateChartRequest, ctx: Context Review Comment: Can't a decorator handle this problem in a generic way so we keep only the typed `GenerateChartRequest`? -- 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]
