From e2f50f7dab7c8d7435bf00a3878e91f616bda908 Mon Sep 17 00:00:00 2001 From: Amin Ghadersohi Date: Mon, 9 Mar 2026 23:35:50 +0100 Subject: [PATCH] fix(mcp): resolve chatbot tool call flakiness with URL and instruction fixes (#38532) (cherry picked from commit 6ef4794778b4543c09acd7e1a4db57809e5b7238) --- superset/mcp_service/sql_lab/tool/open_sql_lab_with_context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/mcp_service/sql_lab/tool/open_sql_lab_with_context.py b/superset/mcp_service/sql_lab/tool/open_sql_lab_with_context.py index a04bd51566d..c5402d951ad 100644 --- a/superset/mcp_service/sql_lab/tool/open_sql_lab_with_context.py +++ b/superset/mcp_service/sql_lab/tool/open_sql_lab_with_context.py @@ -35,6 +35,7 @@ from superset.mcp_service.sql_lab.schemas import ( SqlLabResponse, ) from superset.mcp_service.utils.schema_utils import parse_request +from superset.mcp_service.utils.url_utils import get_superset_base_url logger = logging.getLogger(__name__) @@ -105,7 +106,7 @@ def open_sql_lab_with_context( # Construct SQL Lab URL with full base URL query_string = urlencode(params) - url = f"/sqllab?{query_string}" + url = f"{get_superset_base_url()}/sqllab?{query_string}" logger.info( "Generated SQL Lab URL for database %s", request.database_connection_id