Skip to content

Conversation

@gavin-aguiar
Copy link
Contributor

Motivation and Context

Fixes: #3031

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@gavin-aguiar gavin-aguiar requested a review from a team as a code owner January 30, 2026 21:40
Copilot AI review requested due to automatic review settings January 30, 2026 21:40
@github-actions github-actions bot changed the title Updating MCP endpoint parameters to use snake case Python: Updating MCP endpoint parameters to use snake case Jan 30, 2026
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azurefunctions/agent_framework_azurefunctions
   _app.py3688576%202–203, 208–209, 320–321, 429, 437–438, 458–460, 466–468, 474–476, 509–510, 570–571, 620–621, 626, 708, 711, 720–722, 724–726, 728, 730, 741, 743–746, 748, 750–751, 753, 760–761, 763–764, 766–767, 769, 773, 783–785, 787–788, 790–792, 799, 801–802, 804, 825, 830, 842, 917, 927, 934–936, 981, 995, 1006–1008, 1010–1013, 1038, 1045, 1047, 1050
TOTAL16249202487% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3720 221 💤 0 ❌ 0 🔥 1m 7s ⏱️

Copy link
Contributor

Copilot AI left a 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 threadId to thread_id in the MCP tool properties schema.
  • Updated MCP invocation handling to read thread_id from the MCP context arguments.
  • Updated unit tests to send thread_id in 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")
Copy link

Copilot AI Jan 30, 2026

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.

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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Modify MCP endpoint to use snake_case for parameters

3 participants