Files
agent-framework/python/samples/05-end-to-end
T
Giles Odigwe d992febe9b Python: Fix agent_with_hosted_mcp sample to use Foundry client for MCP tools (#4867)
* Fix agent_with_hosted_mcp sample to use AzureOpenAIResponsesClient (#4861)

The agent_with_hosted_mcp sample used AzureOpenAIChatClient with an MCP tool
dict, but the Chat Completions API only supports 'function' and 'custom' tool
types, not 'mcp'. This caused a 400 error at runtime.

Switch the sample to AzureOpenAIResponsesClient which natively supports MCP
tools via the Responses API. Use get_mcp_tool() to construct the tool config.

Changes:
- main.py: Replace AzureOpenAIChatClient with AzureOpenAIResponsesClient
- requirements.txt: Update azure-ai-agentserver-agentframework to 1.0.0b16
  and use agent-framework-azure-ai package
- agent.yaml: Use AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME env var
- Add regression test documenting chat client MCP tool passthrough behavior

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Python: Fix agent_with_hosted_mcp sample to use Responses API client for MCP tools

Fixes #4861

* Remove REPRODUCTION_REPORT.md investigation artifact (#4861)

Remove the reproduction report markdown file from the test directory.
Investigation notes belong in the GitHub issue or PR description,
not as committed files in the source tree. The regression test in
test_openai_chat_client.py already provides automated verification.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add MCP tool API rejection regression test (#4861)

Add test_mcp_tool_dict_causes_api_rejection to verify that MCP tool
dicts passed through to the Chat Completions API result in a clear
ChatClientException rather than being silently dropped. This completes
the regression test coverage requested in code review.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* small fix

* Revert deletion of dotnet local.settings.json files

Restore the two local.settings.json files that were accidentally deleted in this PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d992febe9b ยท 2026-03-31 22:04:54 +00:00
History
..