You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ar...@apache.org on 2026/03/09 22:35:57 UTC
(superset) branch master updated: fix(mcp): resolve chatbot tool call flakiness with URL and instruction fixes (#38532)
This is an automated email from the ASF dual-hosted git repository.
arivero pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 6ef4794778b fix(mcp): resolve chatbot tool call flakiness with URL and instruction fixes (#38532)
6ef4794778b is described below
commit 6ef4794778b4543c09acd7e1a4db57809e5b7238
Author: Amin Ghadersohi <am...@gmail.com>
AuthorDate: Mon Mar 9 23:35:50 2026 +0100
fix(mcp): resolve chatbot tool call flakiness with URL and instruction fixes (#38532)
---
superset/mcp_service/app.py | 14 ++++++++++++++
.../mcp_service/sql_lab/tool/open_sql_lab_with_context.py | 3 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/superset/mcp_service/app.py b/superset/mcp_service/app.py
index dd48c0a6766..a26167151f0 100644
--- a/superset/mcp_service/app.py
+++ b/superset/mcp_service/app.py
@@ -142,6 +142,20 @@ Query Examples:
- My dashboards:
filters=[{{"col": "created_by_fk", "opr": "eq", "value": <user_id>}}]
+To modify an existing chart (add filters, change metrics, change dimensions, etc.):
+1. get_chart_info(chart_id) -> examine current configuration
+2. update_chart(chart_id, config) -> apply changes (filters, metrics, dimensions)
+Do NOT use execute_sql for chart modifications. Use update_chart instead.
+
+CRITICAL RULES - NEVER VIOLATE:
+- NEVER fabricate or invent URLs. ALL URLs must come from tool call results.
+ If you need a link, call the appropriate tool (generate_explore_link, generate_chart,
+ open_sql_lab_with_context, etc.) and use the URL it returns.
+- To modify an existing chart's filters, metrics, or dimensions, use update_chart.
+ Do NOT use execute_sql for chart modifications.
+- Parameter name reminders: open_sql_lab_with_context uses "sql" (not "query"),
+ execute_sql uses "sql" (not "query").
+
General usage tips:
- All listing tools use 1-based pagination (first page is 1)
- Use get_schema to discover filterable columns, sortable columns, and default columns
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 cfedc72bd93..d27b970d609 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
@@ -33,6 +33,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__)
@@ -95,7 +96,7 @@ def open_sql_lab_with_context(
# Construct SQL Lab 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