Skip to content

Changes made to the MCP tool registration service#186

Open
Koolsiddude wants to merge 4 commits intomicrosoft:mainfrom
Koolsiddude:changes
Open

Changes made to the MCP tool registration service#186
Koolsiddude wants to merge 4 commits intomicrosoft:mainfrom
Koolsiddude:changes

Conversation

@Koolsiddude
Copy link

@Koolsiddude Koolsiddude commented Feb 27, 2026

Summary

This PR updates Agent Framework integration code to align with the latest Python API changes where chat message store abstractions were replaced by history providers and several import/parameter names were normalized.

Why this change

ChatMessageStoreProtocol is no longer available in newer Agent Framework releases, and some API parameter/import names have changed (including chat_client to client). Without this migration, imports and chat-history forwarding code can fail at runtime.

What changed

1) Import migration

  • Replaced ChatMessageStoreProtocol import with BaseHistoryProvider.

2) Method signature migration

  • Updated send_chat_history_from_store(...) to accept:
    • history_provider: BaseHistoryProvider
    • session_id: Optional[str] = None

3) Message retrieval migration

  • Replaced old async store call:
    • await chat_message_store.list_messages()
  • With new history-provider API:
    • history_provider.get_messages(session_id=session_id)

4) Validation/messages/docs alignment

  • Updated input validation error text from chat_message_store to history_provider.
  • Updated method docstring text and example to reflect history-provider usage.

5) Additional import/parameter rename alignment

  • Updated other import/parameter usages to match current SDK naming.
  • Aligned references for agent and message where required by updated signatures/types.
  • Renamed chat_client references to client.

File changed

  • libraries\microsoft-agents-a365-tooling-extensions-agentframework\microsoft_agents_a365\tooling\extensions\agentframework\services\mcp_tool_registration_service.py

Backward compatibility notes

  • This change is source-compatible only for callers already using the new Agent Framework history-provider model.
  • Any external callers still passing old chat-message-store objects must be updated to pass a BaseHistoryProvider and optional session_id.
  • Any external callers still using older parameter names (for example chat_client) must be updated to the current names (for example client).

Validation performed

  • Imported updated module successfully:
    • microsoft_agents_a365.tooling.extensions.agentframework.services.mcp_tool_registration_service

Risk assessment

  • Low to medium risk.
  • Scope is limited to one service method and related typing/docs.
  • Main risk is external call sites outside this workspace still using old parameter names or type/shape.

Suggested reviewer checklist

  • Confirm BaseHistoryProvider is the intended abstraction for current Agent Framework version.
  • Confirm session_id propagation is correct for your session model.
  • Confirm there are no external call sites still passing old store protocol instances.
  • Confirm there are no external call sites still using old import/parameter names (agent, message, chat_client) where newer names/signatures are expected.
  • Run end-to-end chat flow to verify chat-history forwarding behavior in MCP threat-protection path.

@Koolsiddude Koolsiddude requested a review from a team as a code owner February 27, 2026 09:29
@Koolsiddude Koolsiddude changed the title changes made to the MCP tool registration service Changes made to the MCP tool registration service Feb 27, 2026
@Koolsiddude
Copy link
Author

@microsoft-github-policy-service agree

nikhilNava
nikhilNava previously approved these changes Mar 2, 2026
Copy link
Contributor

@nikhilNava nikhilNava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the dependency to the latest on the root *.toml file

@Koolsiddude Koolsiddude marked this pull request as draft March 2, 2026 14:32
@Koolsiddude Koolsiddude marked this pull request as ready for review March 2, 2026 14:45
@Koolsiddude Koolsiddude requested a review from a team as a code owner March 2, 2026 14:45
@Koolsiddude Koolsiddude requested a review from nikhilNava March 2, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants