-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: Filter response_format from MCP tool call kwargs #3494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR aims to fix a bug where MCP tool calls fail when non-serializable framework arguments like response_format are passed through. The fix adds response_format to the exclusion list in the call_tool method's filtering logic.
Changes:
- Added
response_formatto the framework kwargs exclusion set inMCPTool.call_tool()method - Added three unit tests for logging level configuration in MCP connections (unrelated to the PR's stated purpose)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| python/packages/core/agent_framework/_mcp.py | Adds response_format to the exclusion set when filtering kwargs before passing to MCP session |
| python/packages/core/tests/core/test_mcp.py | Adds three tests for MCP server logging level configuration (appears unrelated to response_format filtering) |
Motivation and Context
Filters out response_format from kwargs before forwarding to MCP servers, preventing serialization errors when using structured outputs with MCP tools.
Also added three unit tests for logging level configuration in MCP connections (unrelated to the PR's stated purpose).
Resolves #3483
Description
Contribution Checklist