Skip to content

Commit 5d88894

Browse files
authored
feat: introduce ToolsConfiguration on AgentMcpResourceConfig (#1655)
1 parent 010a8b7 commit 5d88894

3 files changed

Lines changed: 41 additions & 6 deletions

File tree

packages/uipath/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.10.67"
3+
version = "2.10.68"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

packages/uipath/src/uipath/agent/models/agent.py

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,48 @@ class AgentMcpTool(BaseCfg):
446446

447447

448448
class DynamicToolsMode(str, CaseInsensitiveEnum):
449-
"""Dynamic tools mode enumeration."""
449+
"""Dynamic tools mode enumeration.
450+
451+
Deprecated: kept for backwards compatibility with older ``agent.json`` files
452+
that still serialize the ``dynamicTools`` field. New code should use
453+
:class:`ToolsConfiguration` (see ``AgentMcpResourceConfig.tools_configuration``).
454+
"""
450455

451456
NONE = "none"
452457
SCHEMA = "schema"
453458
ALL = "all"
454459

455460

461+
class CachedToolsConfig(BaseCfg):
462+
"""Cached tools configuration: use the tools saved in the agent definition snapshot."""
463+
464+
type: Literal["cached"] = Field(default="cached", frozen=True)
465+
466+
467+
class DynamicToolsConfig(BaseCfg):
468+
"""Dynamic tools configuration: fetch the tool list from the MCP server at runtime.
469+
470+
When ``allow_all`` is true, every tool the server exposes is forwarded
471+
to the agent. When false, the live list is filtered by the snapshot's
472+
``available_tools`` allowlist (live schemas, curated tool set).
473+
"""
474+
475+
type: Literal["dynamic"] = Field(default="dynamic", frozen=True)
476+
allow_all: bool = Field(alias="allowAll")
477+
478+
479+
DiscoveryMode = Annotated[
480+
Union[CachedToolsConfig, DynamicToolsConfig],
481+
Field(discriminator="type"),
482+
]
483+
484+
485+
class ToolsConfiguration(BaseCfg):
486+
"""Configuration describing how tools are sourced for an MCP resource."""
487+
488+
discovery_mode: DiscoveryMode = Field(alias="discoveryMode")
489+
490+
456491
class AgentMcpResourceConfig(BaseAgentResourceConfig):
457492
"""Agent MCP resource configuration model."""
458493

@@ -462,8 +497,8 @@ class AgentMcpResourceConfig(BaseAgentResourceConfig):
462497
folder_path: str = Field(alias="folderPath")
463498
slug: str = Field(..., alias="slug")
464499
available_tools: List[AgentMcpTool] = Field(..., alias="availableTools")
465-
dynamic_tools: DynamicToolsMode = Field(
466-
default=DynamicToolsMode.NONE, alias="dynamicTools"
500+
tools_configuration: Optional[ToolsConfiguration] = Field(
501+
default=None, alias="toolsConfiguration"
467502
)
468503

469504

packages/uipath/uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)