codeant-ai-for-open-source[bot] commented on code in PR #43529:
URL: https://github.com/apache/superset/pull/43529#discussion_r3858464045
##########
tests/unit_tests/mcp_service/test_mcp_tool_registration.py:
##########
@@ -57,6 +57,31 @@ def test_mcp_app_imports_successfully():
assert "list_charts" in tool_names
+def test_all_registered_tools_have_complete_annotations():
+ """Every advertised tool declares all MCP safety annotations."""
+ required_fields = (
+ "title",
+ "readOnlyHint",
+ "destructiveHint",
+ "openWorldHint",
+ )
+ missing_by_tool = {}
+
+ for registered_tool in _run(mcp.list_tools()):
+ annotations = registered_tool.annotations
+ missing = [
+ field
+ for field in required_fields
+ if annotations is None or getattr(annotations, field, None) is None
Review Comment:
**Suggestion:** The registration test only checks that `openWorldHint` is
non-`None`, so an accidental `openWorldHint=True` would pass even though this
change requires every registered tool to be explicitly classified as
closed-world. Assert the expected boolean value for each tool, or at least
assert that all advertised tools have `openWorldHint is False`, so future
annotation changes cannot silently weaken the safety classification. [incorrect
condition logic]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Future tools can advertise incorrect open-world semantics.
- ⚠️ MCP clients may apply weaker trust or confirmation handling.
- ⚠️ Registration tests would not detect policy regressions.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=9f41294887d54ca1ab145b711113ae40&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=9f41294887d54ca1ab145b711113ae40&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/mcp_service/test_mcp_tool_registration.py
**Line:** 62:75
**Comment:**
*Incorrect Condition Logic: The registration test only checks that
`openWorldHint` is non-`None`, so an accidental `openWorldHint=True` would pass
even though this change requires every registered tool to be explicitly
classified as closed-world. Assert the expected boolean value for each tool, or
at least assert that all advertised tools have `openWorldHint is False`, so
future annotation changes cannot silently weaken the safety classification.
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%2F43529&comment_hash=79fdd04bed86127f8cbe543d1dca9a729b9de5fea893185f1fba12128fe7bde9&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43529&comment_hash=79fdd04bed86127f8cbe543d1dca9a729b9de5fea893185f1fba12128fe7bde9&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]