aminghadersohi commented on code in PR #39919:
URL: https://github.com/apache/superset/pull/39919#discussion_r3211990457
##########
superset/mcp_service/chart/tool/get_chart_preview.py:
##########
@@ -1193,7 +1193,10 @@ def __init__(self, form_data: Dict[str, Any]):
if not chart:
await ctx.warning("Chart not found: identifier=%s" %
(request.identifier,))
return ChartError(
- error=f"No chart found with identifier: {request.identifier}",
+ error=(
+ f"No chart found with identifier: {request.identifier}."
+ " Use list_charts to get valid chart IDs."
+ ),
Review Comment:
Fixed in 52f70c84c9. When the identifier looks like a form_data_key (long
non-numeric string), the error now gives a context-aware recovery hint pointing
to generate_explore_link for a fresh key, or list_charts for saved charts. For
numeric ID or UUID identifiers, the suggestion remains list_charts.
##########
superset/mcp_service/chart/tool/update_chart.py:
##########
@@ -343,10 +343,12 @@ async def update_chart( # noqa: C901
"error": {
"error_type": "NotFound",
"message": (
- f"No chart found with identifier:
{request.identifier}"
+ f"No chart found with identifier:
{request.identifier}."
+ " Use list_charts to get valid chart IDs."
),
"details": (
- f"No chart found with identifier:
{request.identifier}"
+ f"No chart found with identifier:
{request.identifier}."
+ " Use list_charts to get valid chart IDs."
Review Comment:
Fixed in 52f70c84c9. The identifier is now truncated to 200 chars via
str(request.identifier)[:200] before being embedded in any error message,
preventing injection through oversized attacker-controlled identifier values.
Applied to get_chart_preview, get_chart_data, and update_chart.
--
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]