Python: Updating MCP endpoint parameters to use snake case#3543
Open
gavin-aguiar wants to merge 1 commit intomainfrom
Open
Python: Updating MCP endpoint parameters to use snake case#3543gavin-aguiar wants to merge 1 commit intomainfrom
gavin-aguiar wants to merge 1 commit intomainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
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. |
Comment on lines
+613
to
+614
| # Extract optional thread_id | ||
| thread_id = arguments.get("thread_id") |
There was a problem hiding this comment.
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.
Suggested change
| # 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 |
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 and Context
Fixes: #3031
Description
Contribution Checklist