Repository navigation
Python: Enable tool search in the Foundry Toolbox sample - #9113
Naveen Chatlapalli (1aifanatic) wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused sample changes consistently implement version-pinned toolbox tool search without introducing unresolved issues.
Review effort: Balanced
Findings: None
What changed in this PR
Enables on-demand tool discovery in the Python Foundry Toolbox sample while preserving existing toolbox versions.
Changes:
- Adds
ToolSearchToolboxToolalongside the MCP toolbox tool. - Connects the agent to the newly created version-specific MCP endpoint.
- Updates the sample index and query to demonstrate tool discovery.
| File | Description |
|---|---|
python/samples/02-agents/providers/foundry/README.md |
Updates the toolbox sample description. |
python/samples/02-agents/providers/foundry/foundry_chat_client_with_toolbox.py |
Provisions tool search and uses the exact created toolbox version. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Eduard van Valkenburg (eavanvalkenburg)
left a comment
There was a problem hiding this comment.
The sample correctly gates the stable toolbox-search model to azure-ai-projects 2.4+, preserves existing toolbox versions, connects to the exact created version endpoint, and uses a query that exercises tool discovery.
Eduard van Valkenburg (eavanvalkenburg)
left a comment
There was a problem hiding this comment.
Naveen Chatlapalli (@1aifanatic) One material compatibility issue remains in python/samples/02-agents/providers/foundry/foundry_chat_client_with_toolbox.py:48. MCPToolboxTool and ToolboxTool are imported before the new guarded import, but neither name exists in azure-ai-projects==2.2.0, which is still permitted by the package dependency floor. Those installations therefore fail with a raw ImportError instead of the actionable azure-ai-projects>=2.4.0 upgrade message. Please move all three toolbox-model imports into the existing guard and add a regression covering the real 2.2 export surface.
MCPToolboxTool and ToolboxTool are missing from azure-ai-projects 2.2.0, which the foundry package still allows, so importing them outside the guard raised a raw ImportError instead of the upgrade message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Eduard van Valkenburg (@eavanvalkenburg) Thanks, you're right. I checked the exports of each release:
ac26635 moves all three imports into the guard, so 2.2.0 and 2.3.0 both get the It also adds I also ran |
Motivation & Context
The Foundry Toolbox Python sample needs to demonstrate discovering tools on demand through toolbox tool search.
Description & Review Guide
Related Issue
Addresses the Python portion of #7489. The .NET contribution remains in #9008; the two PRs are separate language implementations, following the maintainer's request there.
Contribution Checklist