Skip to content

chore(mcp): remove low-value list/info tools that fail agent-native policy#40690

Merged
aminghadersohi merged 4 commits into
masterfrom
sc-107899-mcp-remove-low-value-tools
Jun 6, 2026
Merged

chore(mcp): remove low-value list/info tools that fail agent-native policy#40690
aminghadersohi merged 4 commits into
masterfrom
sc-107899-mcp-remove-low-value-tools

Conversation

@aminghadersohi
Copy link
Copy Markdown
Contributor

@aminghadersohi aminghadersohi commented Jun 2, 2026

SUMMARY

Removes 8 MCP tools that were identified as low-value under our agent-native policy: resources that are purely admin/infrastructure CRUD with no user-facing workflow value.

Removed tools:

  • action_log: list_action_logs, get_action_log_info
  • css_template: list_css_templates, get_css_template_info
  • plugin: list_plugins, get_plugin_info
  • theme: list_themes, get_theme_info

Policy rationale: These tools expose low-level admin/infrastructure resources. Their primary user is an IT admin acting through the API, not an LLM helping an end user with data work.

Full cleanup — nothing left behind:

  • Deleted 8 tool implementation files and 4 test files (initial commit)
  • Deleted entire module directories: action_log/, css_template/, plugin/, theme/ — including all schemas, DAOs, and empty __init__.py files (source + test mirrors)
  • Removed css_template and theme support from get_schema tool (factory functions, routing dict, permission map, docstring)
  • Removed CSS_TEMPLATE_* and THEME_* constants and get_css_template_columns/get_theme_columns functions from common/schema_discovery.py
  • Removed "css_template" and "theme" from constants.ModelType
  • Removed the action_log runtime config guard from _apply_config_guards
  • Updated the system prompt to remove all 8 tool references
  • Removed corresponding test cases from test_get_schema.py and test_mcp_tool_registration.py

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — no UI changes.

TESTING INSTRUCTIONS

  1. Start the MCP service
  2. Verify the 8 removed tools do not appear in list_tools
  3. Verify get_schema rejects model_type="css_template" and model_type="theme" with a validation error
  4. Run pytest tests/unit_tests/mcp_service/ -x to confirm all tests pass

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.20%. Comparing base (0984839) to head (4080da8).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #40690      +/-   ##
==========================================
+ Coverage   64.19%   64.20%   +0.01%     
==========================================
  Files        2666     2649      -17     
  Lines      143991   143315     -676     
  Branches    33108    33069      -39     
==========================================
- Hits        92428    92018     -410     
+ Misses      49950    49688     -262     
+ Partials     1613     1609       -4     
Flag Coverage Δ
hive 39.55% <100.00%> (-0.22%) ⬇️
mysql 58.39% <100.00%> (-0.03%) ⬇️
postgres 58.46% <100.00%> (-0.03%) ⬇️
presto 41.15% <100.00%> (-0.20%) ⬇️
python 59.94% <100.00%> (-0.01%) ⬇️
sqlite 58.08% <100.00%> (-0.03%) ⬇️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 3, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 4080da8
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a23515cb5d05d0008e6fe66
😎 Deploy Preview https://deploy-preview-40690--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@aminghadersohi aminghadersohi marked this pull request as ready for review June 3, 2026 15:46
@aminghadersohi aminghadersohi requested a review from rusackas June 3, 2026 15:55
Comment thread superset/mcp_service/app.py Outdated
@bito-code-review
Copy link
Copy Markdown
Contributor

The flagged issue is correct. The get_schema tool's advertised capabilities in the system instructions currently omit report, which creates a contract mismatch that can lead MCP agents to skip necessary schema discovery for reports. To resolve this, you should update the get_default_instructions function in superset/mcp_service/app.py to include report in the list of supported model types for get_schema.

@aminghadersohi aminghadersohi requested a review from eschutho June 3, 2026 16:09
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jun 3, 2026

Code Review Agent Run #e8ebfe

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/mcp_service/theme/__init__.py - 1
Review Details
  • Files reviewed - 39 · Commit Range: b1508d7..1f8aff5
    • superset/mcp_service/action_log/__init__.py
    • superset/mcp_service/action_log/schemas.py
    • superset/mcp_service/action_log/tool/__init__.py
    • superset/mcp_service/action_log/tool/get_action_log_info.py
    • superset/mcp_service/action_log/tool/list_action_logs.py
    • superset/mcp_service/app.py
    • superset/mcp_service/common/schema_discovery.py
    • superset/mcp_service/constants.py
    • superset/mcp_service/css_template/__init__.py
    • superset/mcp_service/css_template/schemas.py
    • superset/mcp_service/css_template/tool/__init__.py
    • superset/mcp_service/css_template/tool/get_css_template_info.py
    • superset/mcp_service/css_template/tool/list_css_templates.py
    • superset/mcp_service/plugin/__init__.py
    • superset/mcp_service/plugin/dao.py
    • superset/mcp_service/plugin/schemas.py
    • superset/mcp_service/plugin/tool/__init__.py
    • superset/mcp_service/plugin/tool/get_plugin_info.py
    • superset/mcp_service/plugin/tool/list_plugins.py
    • superset/mcp_service/system/tool/get_schema.py
    • superset/mcp_service/theme/__init__.py
    • superset/mcp_service/theme/schemas.py
    • superset/mcp_service/theme/tool/__init__.py
    • superset/mcp_service/theme/tool/get_theme_info.py
    • superset/mcp_service/theme/tool/list_themes.py
    • tests/unit_tests/mcp_service/action_log/__init__.py
    • tests/unit_tests/mcp_service/action_log/tool/__init__.py
    • tests/unit_tests/mcp_service/action_log/tool/test_action_log_tools.py
    • tests/unit_tests/mcp_service/css_template/__init__.py
    • tests/unit_tests/mcp_service/css_template/tool/__init__.py
    • tests/unit_tests/mcp_service/css_template/tool/test_css_template_tools.py
    • tests/unit_tests/mcp_service/plugin/__init__.py
    • tests/unit_tests/mcp_service/plugin/tool/__init__.py
    • tests/unit_tests/mcp_service/plugin/tool/test_plugin_tools.py
    • tests/unit_tests/mcp_service/system/tool/test_get_schema.py
    • tests/unit_tests/mcp_service/test_mcp_tool_registration.py
    • tests/unit_tests/mcp_service/theme/__init__.py
    • tests/unit_tests/mcp_service/theme/tool/__init__.py
    • tests/unit_tests/mcp_service/theme/tool/test_theme_tools.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Copy link
Copy Markdown
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but perhaps worth noting/confirming it's intentional that this removes tools including the plugin tools just added in #40347.

…olicy

Remove 8 MCP tools (list_action_logs, get_action_log_info, list_css_templates,
get_css_template_info, list_plugins, get_plugin_info, list_themes, get_theme_info)
because they expose admin/infrastructure resources with no user-facing workflow
value per the agent-native tool policy.

Also removes the action_log runtime config guard from _apply_config_guards since
those tools no longer exist, and updates the system prompt to reflect the removal.
Remove test cases for the action_log config guard (which no longer exists),
update test_no_disabled_tools_returns_full_instructions to not assert on
removed tools, and retarget test_config_guard_tools_excluded_from_instructions
to the GLOBAL_TASK_FRAMEWORK guard (the only remaining config guard).
Also drops unused fab_security_views/log_view params from _make_flask_app_mock.
…template/plugin/theme tools

Delete entire module directories (source + tests) for the 4 removed tool groups:
action_log, css_template, plugin, theme. Also remove their CSS_TEMPLATE_* and
THEME_* constants from common/schema_discovery.py, strip css_template and theme
support from get_schema tool and constants.ModelType, and drop the corresponding
test cases from test_get_schema.py.

Nothing in the codebase now references any of the 8 removed tool names.
@aminghadersohi aminghadersohi force-pushed the sc-107899-mcp-remove-low-value-tools branch from 1f8aff5 to 4080da8 Compare June 5, 2026 22:44
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jun 6, 2026

Code Review Agent Run #311ad8

Actionable Suggestions - 0
Additional Suggestions - 1
  • tests/unit_tests/mcp_service/action_log/tool/test_action_log_tools.py - 1
    • CWE-20: Test Coverage Gap for Sanitization · Line 339-401
      The removed tests `test_get_action_log_info_malicious_json_key_wrapped` and `test_list_action_logs_malicious_json_key_wrapped` verified a specific edge case: when JSON-serialized strings containing UNTRUSTED-CONTENT tokens are sanitized, the tokens are properly escaped. This scenario is not covered by existing tests in `test_sanitization.py`. Consider adding equivalent tests to maintain coverage of this LLM context injection protection mechanism.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/mcp_service/system/tool/get_schema.py - 3
    • BLOCKER: Diff removes non-existent code · Line 35-68
    • BLOCKER: Diff removes non-existent functions · Line 150-200
    • BLOCKER: Diff removes non-existent dictionary entries · Line 180-245
  • superset/mcp_service/css_template/__init__.py - 1
  • tests/unit_tests/mcp_service/action_log/__init__.py - 1
    • ASF license header removed from source file · Line 1-16
  • tests/unit_tests/mcp_service/plugin/__init__.py - 1
Review Details
  • Files reviewed - 39 · Commit Range: a71176e..4080da8
    • superset/mcp_service/action_log/__init__.py
    • superset/mcp_service/action_log/schemas.py
    • superset/mcp_service/action_log/tool/__init__.py
    • superset/mcp_service/action_log/tool/get_action_log_info.py
    • superset/mcp_service/action_log/tool/list_action_logs.py
    • superset/mcp_service/app.py
    • superset/mcp_service/common/schema_discovery.py
    • superset/mcp_service/constants.py
    • superset/mcp_service/css_template/__init__.py
    • superset/mcp_service/css_template/schemas.py
    • superset/mcp_service/css_template/tool/__init__.py
    • superset/mcp_service/css_template/tool/get_css_template_info.py
    • superset/mcp_service/css_template/tool/list_css_templates.py
    • superset/mcp_service/plugin/__init__.py
    • superset/mcp_service/plugin/dao.py
    • superset/mcp_service/plugin/schemas.py
    • superset/mcp_service/plugin/tool/__init__.py
    • superset/mcp_service/plugin/tool/get_plugin_info.py
    • superset/mcp_service/plugin/tool/list_plugins.py
    • superset/mcp_service/system/tool/get_schema.py
    • superset/mcp_service/theme/__init__.py
    • superset/mcp_service/theme/schemas.py
    • superset/mcp_service/theme/tool/__init__.py
    • superset/mcp_service/theme/tool/get_theme_info.py
    • superset/mcp_service/theme/tool/list_themes.py
    • tests/unit_tests/mcp_service/action_log/__init__.py
    • tests/unit_tests/mcp_service/action_log/tool/__init__.py
    • tests/unit_tests/mcp_service/action_log/tool/test_action_log_tools.py
    • tests/unit_tests/mcp_service/css_template/__init__.py
    • tests/unit_tests/mcp_service/css_template/tool/__init__.py
    • tests/unit_tests/mcp_service/css_template/tool/test_css_template_tools.py
    • tests/unit_tests/mcp_service/plugin/__init__.py
    • tests/unit_tests/mcp_service/plugin/tool/__init__.py
    • tests/unit_tests/mcp_service/plugin/tool/test_plugin_tools.py
    • tests/unit_tests/mcp_service/system/tool/test_get_schema.py
    • tests/unit_tests/mcp_service/test_mcp_tool_registration.py
    • tests/unit_tests/mcp_service/theme/__init__.py
    • tests/unit_tests/mcp_service/theme/tool/__init__.py
    • tests/unit_tests/mcp_service/theme/tool/test_theme_tools.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@aminghadersohi aminghadersohi merged commit ef7379c into master Jun 6, 2026
58 checks passed
@aminghadersohi aminghadersohi deleted the sc-107899-mcp-remove-low-value-tools branch June 6, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants