feat(agent): add execution.taskSupport to AgentMcpTool#1716
Closed
edis-uipath wants to merge 1 commit into
Closed
Conversation
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>
Contributor
There was a problem hiding this comment.
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
McpToolTaskSupportandAgentMcpToolExecutionmodels to represent MCPexecution.taskSupport. - Extends
AgentMcpToolwith an optionalexecutionfield (aliased toexecution) to mirror MCP’s tool payload shape. - Adds tests ensuring
execution.taskSupportis parsed when present andexecutionremainsNonewhen 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 |
|
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.



Add
execution.taskSupporttoAgentMcpToolMCP 2025-11-25 tools carry an
execution.taskSupportvalue (forbidden/optional/required) that says whether a tool may be invoked as a task (long-running, poll/await).AgentMcpTooldidn'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
McpToolTaskSupportenum (forbidden/optional/required) andAgentMcpToolExecutionmodel (task_support, aliastaskSupport).executionfield onAgentMcpTool(aliasexecution), mirroring the MCP tool'sexecutionobject so a serverToolmaps straight into the snapshot.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
taskSupportin 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
AgentMcpToolparsesexecution.taskSupportwhen present; defaults toNonewhen absent.test_agent.py(81) green; ruff clean.🤖 Generated with Claude Code