Skip to content

feat: use ToolsConfiguration in MCP tool factory#861

Open
radugheo wants to merge 1 commit into
mainfrom
feat/tools-configuration
Open

feat: use ToolsConfiguration in MCP tool factory#861
radugheo wants to merge 1 commit into
mainfrom
feat/tools-configuration

Conversation

@radugheo
Copy link
Copy Markdown
Collaborator

@radugheo radugheo commented May 19, 2026

Summary

Switches create_mcp_tools from config.dynamic_tools (legacy enum) to config.tools_configuration.cached_behaviour (new discriminated union from uipath.agent.models.agent). All three previous modes are preserved:

  • Cached preserves the previous none behaviour — snapshot only, no network call.
  • Schema preserves the previous schema behaviour — 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.
  • Dynamic preserves the previous all behaviour — server-driven discovery, with snapshot argumentProperties carried over by tool name.

Bumps uipath floor to 2.10.68 (the version that ships Cached / Schema / Dynamic / ToolsConfiguration).

Patch version bumped: 0.11.00.11.1.

Related PRs (must land together)

Test plan

  • tests/agent/tools/test_mcp/ — 56 tests passing against editable install of uipath-python PR 1655
  • TestToolsConfiguration test class covers Cached, Schema, and Dynamic paths
image image

Development Package

  • Use uipath pack --nolock to get the latest dev build from this PR (requires version range).
  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-langchain==0.11.2.dev1008614625",

  # Any version from PR
  "uipath-langchain>=0.11.2.dev1008610000,<0.11.2.dev1008620000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-langchain = { index = "testpypi" }

[tool.uv]
override-dependencies = [
    "uipath-langchain>=0.11.2.dev1008610000,<0.11.2.dev1008620000",
]

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 with ToolsConfiguration(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 uipath dependency 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.

Comment thread pyproject.toml
@radugheo radugheo force-pushed the feat/tools-configuration branch 2 times, most recently from c35454a to a1c5d19 Compare May 19, 2026 15:57
@radugheo radugheo force-pushed the feat/tools-configuration branch 4 times, most recently from 937a182 to b771a0e Compare May 20, 2026 08:38
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>
@radugheo radugheo force-pushed the feat/tools-configuration branch from b771a0e to 5c0830b Compare May 20, 2026 08:49
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants