Add WorkIQ (Agent 365) MCP tool integration to the Python agent-framework weather sample#645
Open
vinchencc wants to merge 2 commits into
Open
Add WorkIQ (Agent 365) MCP tool integration to the Python agent-framework weather sample#645vinchencc wants to merge 2 commits into
vinchencc wants to merge 2 commits into
Conversation
|
@vinchencc please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
Summary
Extends the Python
agent-frameworkweather sample with WorkIQ (Microsoft 365 / Agent 365) tools served over the Model Context Protocol (MCP). The agent now routes US-weather questions to the existing local weather tools and everything else (Teams chat, mail, files, calendar, general M365 Q&A) to the WorkIQ MCP tools.The integration is additive and degrades gracefully: if WorkIQ isn't configured or its packages aren't installed, the agent keeps running in weather-only mode.
What changed
samples/python/agent-framework/src/agent.pyMcpToolRegistrationService; lazy, cachedget_agent()that attaches WorkIQ MCP tools on the first turn; supports both local bearer-token auth and OBO/agentic auth; falls back to weather-only on failure. Updated welcome message and clarifying comments.samples/python/agent-framework/requirements.txtmicrosoft-agents-a365-tooling,microsoft-agents-a365-tooling-extensions-agentframework,microsoft-agents-a365-runtime.samples/python/agent-framework/env.TEMPLATEBEARER_TOKEN,USE_AGENTIC_AUTH,WORKIQ_AUTH_HANDLER,SKIP_TOOLING_ON_ERRORS,PYTHON_ENVIRONMENT,MCP_PLATFORM_ENDPOINT.samples/python/agent-framework/README.mdRouting behavior
get_current_weather,get_weather_forecast,get_dateAuth modes
a365 develop get-tokenintoBEARER_TOKEN.USE_AGENTIC_AUTH=trueandWORKIQ_AUTH_HANDLER; the SDK performs OBO token exchange.Fallback
When WorkIQ is unavailable and
SKIP_TOOLING_ON_ERRORS=true(default), setup failures are logged and the agent continues serving weather-only rather than crashing.Testing