Skip to content

feat(agent): add execution.taskSupport to AgentMcpTool#1716

Closed
edis-uipath wants to merge 1 commit into
mainfrom
feat/mcp-tool-task-support
Closed

feat(agent): add execution.taskSupport to AgentMcpTool#1716
edis-uipath wants to merge 1 commit into
mainfrom
feat/mcp-tool-task-support

Conversation

@edis-uipath

Copy link
Copy Markdown
Collaborator

Add execution.taskSupport to AgentMcpTool

MCP 2025-11-25 tools carry an execution.taskSupport value (forbidden / optional / required) that says whether a tool may be invoked as a task (long-running, poll/await). AgentMcpTool didn't model it, so a cached agent snapshot couldn't tell a consumer (e.g. the uipath-langchain MCP client) which tools can be driven as tasks — the consumer would have to fall back to dynamic discovery.

Change

  • New McpToolTaskSupport enum (forbidden / optional / required) and AgentMcpToolExecution model (task_support, alias taskSupport).
  • New optional execution field on AgentMcpTool (alias execution), mirroring the MCP tool's execution object so a server Tool maps straight into the snapshot.
  • Absent on older snapshots → execution is None → treated as not task-augmentable (no behavior change for existing agents).

Why

Enables the uipath-langchain MCP client to gate "call this tool as a task" on the tool's taskSupport in the cached discovery path (not just dynamic discovery), so a UiPath agent can suspend on a child UiPath job started via an MCP task.

Testing

  • AgentMcpTool parses execution.taskSupport when present; defaults to None when absent.
  • mypy clean; full test_agent.py (81) green; ruff clean.

🤖 Generated with Claude Code

MCP 2025-11-25 tools carry execution.taskSupport (forbidden / optional / required),
which says whether a tool may be invoked as a task. AgentMcpTool didn't model it, so a
cached agent snapshot couldn't tell a consumer (e.g. the uipath-langchain MCP client)
which tools can be driven as tasks.

Adds AgentMcpToolExecution (with task_support) and an optional `execution` field on
AgentMcpTool, mirroring the MCP tool's `execution` object so a server Tool maps straight
into the snapshot. Absent on older snapshots -> treated as not task-augmentable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 14, 2026 07:45
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jun 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 uipath.agent.models snapshot schema so cached MCP tool discovery can include MCP’s execution.taskSupport capability signal, enabling downstream consumers to decide whether a tool can be invoked as a long-running task without dynamic discovery.

Changes:

  • Adds McpToolTaskSupport and AgentMcpToolExecution models to represent MCP execution.taskSupport.
  • Extends AgentMcpTool with an optional execution field (aliased to execution) to mirror MCP’s tool payload shape.
  • Adds tests ensuring execution.taskSupport is parsed when present and execution remains None when absent.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/uipath/src/uipath/agent/models/agent.py Adds MCP task-support enum/model and an optional execution field on AgentMcpTool.
packages/uipath/tests/agent/models/test_agent.py Adds unit tests for parsing execution.taskSupport and defaulting execution to None when absent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +468 to +470
task_support: McpToolTaskSupport = Field(
default=McpToolTaskSupport.FORBIDDEN, alias="taskSupport"
)
"inputSchema": {"type": "object", "properties": {}},
}
)
assert tool.execution is None
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants