feat: use ToolsConfiguration in MCP tool factory#861
Open
radugheo wants to merge 1 commit into
Open
Conversation
2 tasks
There was a problem hiding this comment.
Pull request overview
This PR updates the MCP tool factory to use the newer ToolsConfiguration model (Cached vs Dynamic) instead of the previous DynamicToolsMode enum, aligning MCP tool loading behavior with the upstream UiPath SDK configuration.
Changes:
- Replace
DynamicToolsMode-based branching withToolsConfiguration(cached_behaviour=...)(Cached default vs Dynamic list-from-server behavior). - Update MCP tool tests to validate the new Cached/Dynamic semantics and remove schema/all mode assertions.
- Bump package version and raise the minimum
uipathdependency version to pick up the new models.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/uipath_langchain/agent/tools/mcp/mcp_tool.py |
Switch tool-loading logic from dynamic_tools to tools_configuration.cached_behaviour (Cached vs Dynamic). |
tests/agent/tools/test_mcp/test_mcp_tool.py |
Update/rename tests to cover ToolsConfiguration behavior and Dynamic list-tools flow. |
pyproject.toml |
Bump library version and update the minimum uipath dependency version. |
c35454a to
a1c5d19
Compare
937a182 to
b771a0e
Compare
Switches `create_mcp_tools` from `config.dynamic_tools` (legacy enum) to `config.tools_configuration.cached_behaviour` (new discriminated union). Cached preserves the previous `none` behaviour (snapshot only, no network); Dynamic preserves the previous `all` behaviour (server-driven discovery with snapshot argumentProperties carried over by name). Schema mode is dropped from this code path for the sprint and will be reintroduced once the model exposes it again. Bumps uipath floor to 2.10.68 (the version that ships Cached / Dynamic / ToolsConfiguration). Related uipath-python PR: https://github.com/UiPath/uipath-python/pull (feat/tools-configuration) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
b771a0e to
5c0830b
Compare
|
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
Switches
create_mcp_toolsfromconfig.dynamic_tools(legacy enum) toconfig.tools_configuration.cached_behaviour(new discriminated union fromuipath.agent.models.agent). All three previous modes are preserved:nonebehaviour — snapshot only, no network call.schemabehaviour — server discovery with snapshot allowlist filter, live schemas/descriptions. Not currently exposed in the frontend; runtime keeps honouring it so the option can be re-enabled later.allbehaviour — server-driven discovery, with snapshotargumentPropertiescarried over by tool name.Bumps
uipathfloor to2.10.68(the version that shipsCached/Schema/Dynamic/ToolsConfiguration).Patch version bumped:
0.11.0→0.11.1.Related PRs (must land together)
Test plan
tests/agent/tools/test_mcp/— 56 tests passing against editable install of uipath-python PR 1655TestToolsConfigurationtest class covers Cached, Schema, and Dynamic pathsDevelopment Package
uipath pack --nolockto get the latest dev build from this PR (requires version range).