Normalize outbound MCP tool arguments - #1172
Merged
Merged
Conversation
Unwrap schema-aware kwargs wrappers before outbound MCP validation and invocation so standards-compliant MCP servers receive required parameters at the top level. Add regression coverage for plugin and factory call paths while preserving legitimate kwargs fields. Fixes #1163 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the unnecessary App Insights logger lambda in the MCP argument normalization functional test with the named no-op logger helper pattern used by nearby MCP tests. Update branch version metadata for the follow-up change. Refs #1163 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bionic711
marked this pull request as ready for review
August 7, 2026 21:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Outbound MCP tools that receive parameters through Semantic Kernel can arrive at SimpleChat as a single
kwargswrapper. Standards-compliant MCP servers expect tool parameters as top-level fields inside thetools/callargumentsobject, so wrapped payloads such as{ "kwargs": { "type": "..." } }can make required fields invisible to servers such as Splunk MCP. This fixes issue #1163 so parameterized outbound MCP tools receive the expected argument shape while no-parameter tools and legitimatekwargsfields remain safe.Description & Review Guide
What are the major changes?
functions_mcp_operations.py.McpPlugin.call_tool(...)before validation and invocation.McpPluginFactory.call_tool_from_config(...)for direct factory callers with cached tool metadata.functional_tests/test_mcp_tool_argument_normalization.pycovering plugin and factory paths, direct top-level args, wrapped kwargs, legitimate kwargs schemas, and no-argument calls.config.pyto0.250.127and added release notes.What is the impact of these changes?
typeat the top level expected by MCP servers.kwargsproperty continue to receive that wrapper unchanged.What do you want reviewers to focus on?
Local validation completed before opening this draft:
python functional_tests\test_mcp_tool_argument_normalization.pypython functional_tests\test_mcp_action_manifest_workflow.pypython functional_tests\test_mcp_phase2_probe_metadata.pypython functional_tests\test_mcp_destination_governance_and_preconfigurations.pypython functional_tests\test_local_mcp_server.pypython functional_tests\test_app_version_assertion_guardrails.pypython -m py_compile application\single_app\config.py application\single_app\functions_mcp_operations.py application\single_app\semantic_kernel_plugins\mcp_plugin.py application\single_app\semantic_kernel_plugins\mcp_plugin_factory.py functional_tests\test_mcp_tool_argument_normalization.pypython scripts\check_xss_sinks.py --full-file application\single_app\config.py application\single_app\functions_mcp_operations.py application\single_app\semantic_kernel_plugins\mcp_plugin.py application\single_app\semantic_kernel_plugins\mcp_plugin_factory.pypython scripts\check_broken_access_control.py --full-file application\single_app\config.py application\single_app\functions_mcp_operations.py application\single_app\semantic_kernel_plugins\mcp_plugin.py application\single_app\semantic_kernel_plugins\mcp_plugin_factory.pygit diff --checkRelated Issue
Fixes #1163
Contribution Checklist