-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: Updating MCP endpoint parameters to use snake case #3543
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
Updates the Azure Functions MCP tool trigger to use snake_case for the thread identifier parameter, aligning MCP parameter naming with other endpoints and addressing #3031.
Changes:
- Renamed MCP tool parameter from
threadIdtothread_idin the MCP tool properties schema. - Updated MCP invocation handling to read
thread_idfrom the MCP context arguments. - Updated unit tests to send
thread_idin MCP invocation contexts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/packages/azurefunctions/agent_framework_azurefunctions/_app.py | Changes MCP tool schema + argument parsing to use thread_id instead of threadId. |
| python/packages/azurefunctions/tests/test_app.py | Updates MCP tool invocation tests to pass thread_id. |
| # Extract optional thread_id | ||
| thread_id = arguments.get("thread_id") |
Copilot
AI
Jan 30, 2026
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.
Switching the MCP argument name from threadId to thread_id means existing MCP clients still sending threadId will silently lose conversation continuity (a breaking API behavior change). Consider accepting both keys during a transition period (e.g., read thread_id and fall back to threadId, optionally with a deprecation warning), or explicitly mark/document this as a breaking change for consumers.
| # Extract optional thread_id | |
| thread_id = arguments.get("thread_id") | |
| # Extract optional thread_id (prefer snake_case, but support legacy camelCase 'threadId') | |
| thread_id = arguments.get("thread_id") | |
| if thread_id is None: | |
| legacy_thread_id = arguments.get("threadId") | |
| if legacy_thread_id is not None: | |
| logger.warning( | |
| "MCP argument 'threadId' is deprecated; please use 'thread_id' instead." | |
| ) | |
| thread_id = legacy_thread_id |
Motivation and Context
Fixes: #3031
Description
Contribution Checklist