codeant-ai-for-open-source[bot] commented on code in PR #42070:
URL: https://github.com/apache/superset/pull/42070#discussion_r3592116087
##########
superset/mcp_service/chart/tool/get_chart_type_schema.py:
##########
@@ -223,6 +239,7 @@ def get_chart_type_schema(
Valid chart_type values: xy, table, pie, pivot_table,
mixed_timeseries, handlebars, big_number, histogram, box_plot.
+ mixed_timeseries, handlebars, big_number, waterfall.
Review Comment:
**Suggestion:** The added valid-values line in the tool docstring duplicates
entries and creates an inconsistent contract description, which can mislead
clients that rely on this docstring for prompt/tool guidance. Update the line
so the list is a single canonical set that exactly matches `VALID_CHART_TYPES`.
[docstring mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ MCP tool docs show duplicated chart types confusing clients.
- ⚠️ LLM guidance inconsistent with canonical VALID_CHART_TYPES contract.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open `superset/mcp_service/chart/tool/get_chart_type_schema.py` and
locate the
`get_chart_type_schema` function definition at lines 231–247, which is
decorated with
`@tool` and whose docstring is exposed to MCP clients.
2. Inspect the docstring block at lines 235–243 and observe the `Valid
chart_type values:`
paragraph on lines 240–242, which reads: `Valid chart_type values: xy,
table, pie,
pivot_table,` / `mixed_timeseries, handlebars, big_number, histogram,
box_plot.` /
`mixed_timeseries, handlebars, big_number, waterfall.` — note the duplicated
`mixed_timeseries, handlebars, big_number` segment and the separate trailing
`waterfall`
line.
3. In the same file, review the chart type contract defined at lines 45–59
where
`_CHART_TYPE_ADAPTERS` and `VALID_CHART_TYPES =
sorted(_CHART_TYPE_ADAPTERS.keys())` are
declared; this produces the canonical set
`{"xy","table","pie","pivot_table","mixed_timeseries","handlebars","big_number","histogram","box_plot","waterfall"}`
without duplicates.
4. Compare the docstring’s human-readable list to `VALID_CHART_TYPES` and
see that while
the underlying set of values matches, the docstring presents them as two
concatenated
lists with repeated entries, so any MCP client or LLM relying on this
docstring for
guidance (for example, per the instructions in `superset/mcp_service/app.py`
lines 15–22
referencing `get_chart_type_schema(chart_type="xy")`) will see an
inconsistent, duplicated
description of valid chart types.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ac92ab8dafb34778843350ec4bdf6293&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ac92ab8dafb34778843350ec4bdf6293&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/mcp_service/chart/tool/get_chart_type_schema.py
**Line:** 242:242
**Comment:**
*Docstring Mismatch: The added valid-values line in the tool docstring
duplicates entries and creates an inconsistent contract description, which can
mislead clients that rely on this docstring for prompt/tool guidance. Update
the line so the list is a single canonical set that exactly matches
`VALID_CHART_TYPES`.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42070&comment_hash=a4ff408b89932e9034554d11cb5beb30570894fd736b70e77a64c9fcccdea5a1&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42070&comment_hash=a4ff408b89932e9034554d11cb5beb30570894fd736b70e77a64c9fcccdea5a1&reaction=dislike'>👎</a>
--
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]