You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2026/07/31 22:40:08 UTC

[PR] fix(mcp): missing params in MCP tool call logs [superset]

justinpark opened a new pull request, #42660:
URL: https://github.com/apache/superset/pull/42660

   ### SUMMARY
   LoggingMiddleware and ResponseSizeGuardMiddleware extracted tool call parameters via getattr(context.message, "params", {}). The real MCP SDK type for a tools/call request (mcp.types.CallToolRequestParams) has no params attribute — it exposes name and arguments — so the getattr fallback always silently returned {}. As a result, every MCP tool call log recorded params: {} and dashboard_id/slice_id/dataset_id as null, regardless of what the caller actually sent, making the audit logs useless for debugging or analytics.
   
   Fixed both call sites to read context.message.arguments instead. Also updated the existing unit test mocks, which had been setting context.message.params on MagicMock objects — mirroring the same wrong attribute name as the bug, which is why the regression went undetected — and added a regression test that constructs a real mcp.types.CallToolRequestParams object to catch this class of attribute-name mismatch going forward.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before:
   
   ```
   {"tool": "get_dashboard_info", "agent_id": null, "params": {}, "method": "tools/call", "dashboard_id": null,
     "slice_id": null, "dataset_id": null, "success": false}
   ```
   
   After:
   
   ```
   {"tool": "get_dashboard_info", "agent_id": null, "params": {"request": {"identifier": 286}}, "method": "tools/call", "dashboard_id": null, "slice_id": null, "dataset_id": null, "success": false}
   ```
   
   ### TESTING INSTRUCTIONS
   
   - pytest tests/unit_tests/mcp_service/test_middleware.py tests/unit_tests/mcp_service/test_middleware_logging.py -q — all 124 tests pass, including the new regression test (verified it fails against the pre-fix code).
   - Manually verified end-to-end on a live dev pod: ran superset mcp run, called get_dashboard_info via a real MCP client, and confirmed via the logs table in the metadata DB that params now contains the actual call arguments (e.g. {"request": {"identifier": 286}}) instead of {}.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): missing params in MCP tool call logs [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42660:
URL: https://github.com/apache/superset/pull/42660#issuecomment-5148087286

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42660?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `2 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 55.87%. Comparing base ([`0981b11`](https://app.codecov.io/gh/apache/superset/commit/0981b1101a26c55359e87e01c8962b48449bfb52?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1414752`](https://app.codecov.io/gh/apache/superset/commit/1414752b04fc365c407774b2e1c316ee49d9718d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 5 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/42660?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/mcp\_service/middleware.py](https://app.codecov.io/gh/apache/superset/pull/42660?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fmiddleware.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvbWlkZGxld2FyZS5weQ==) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/42660?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (0981b11) and HEAD (1414752). Click for more details.
   > 
   > <details><summary>HEAD has 36 uploads less than BASE</summary>
   >
   >| Flag | BASE (0981b11) | HEAD (1414752) |
   >|------|------|------|
   >|hive|5|1|
   >|python|30|2|
   >|presto|5|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #42660      +/-   ##
   ==========================================
   - Coverage   65.45%   55.87%   -9.59%     
   ==========================================
     Files        2810     2810              
     Lines      159362   159422      +60     
     Branches    36374    36382       +8     
   ==========================================
   - Hits       104308    89074   -15234     
   - Misses      53012    69516   +16504     
   + Partials     2042      832    -1210     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.07% <0.00%> (-0.02%)` | :arrow_down: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.96% <0.00%> (-0.03%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.02% <0.00%> (-19.25%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/42660/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/42660?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): missing params in MCP tool call logs [superset]

Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark merged PR #42660:
URL: https://github.com/apache/superset/pull/42660


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): missing params in MCP tool call logs [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42660:
URL: https://github.com/apache/superset/pull/42660#issuecomment-5148060994

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org