Are MCP tools broken in Workflows? #13
BethanyJep
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am having troubles with my workflows, I had made a workflow that worked a few weeks ago. Now I wanted to call it from my local machine with the code that is supplied by it. I got an error saying that it couldn't wait for approval, which made sense to me. Time to turn on auto-approval. But then the workflow still didn't work, not even through the portal.
I simplified my workflow to just 1 agent invoke step now and the issue persists.
Test 1
I make a new agent that has 1 MCP tool and nothing else. I test the agent in the portal and it works for answering both regular questions and making tool calls. It will ask me for approval first by default and then approving it will do the tool call correctly.
Testing it in a workflow then means, first with a regular call that doesn't need a tool and it works fine. Ask for a tool call and it will ask for approval and then also give this type of error immediately:
invalid_operation_errorRuntime type 'Microsoft.Extensions.AI.McpServerToolApprovalRequestContent' is not supported by polymorphic type 'Microsoft.Extensions.AI.AIContent'. Path: $.AgentResponse.Messages.Contents. -> Runtime type 'Microsoft.Extensions.AI.McpServerToolApprovalRequestContent' is not supported by polymorphic type 'Microsoft.Extensions.AI.AIContent'.
However I can stll press approve, because the approval request is still in the debug screen. When I approve it will respond with:
WORKFLOW_APPROVAL_ERRORThere are no pending mcp_approval_request items for which mcp_approval_response is expected.
Which makes sense I guess, considering the error we had before telling me it can't wait.
Test 2
When I then change it so my agent doesn't need approval anymore: so approval for all tools and testing it in the agent portal. Then the agent stops working, I need to specify allowed tools as well otherwise it can't access any tools it seems.
image
So I specify the 1 tool out of 3 (I also tried naming all tools in that field) that this MCP knows that this agent should use and set it to always approval all tools. Then it works again in the agent portal, it succesfully makes the tool call without asking for approval.
Going back to the workflow portal however now gives me this error:
invalid_operation_errorUnhandled workflow failure - #node-1771869562761 (InvokeAzureAgent) -> The requested operation requires an element of type 'Object', but the target element has type 'Array'.
In this case I also don't see any incoming ListToolsRequest in my MCP server, so it fails even earlier than with the previous case where it failed to wait for approval, but at least it knew which tool call to make. Now it seems to fail at the very start already.
Workflow info
kind: workflow
trigger:
kind: OnConversationStart
id: trigger_wf
actions:
- kind: InvokeAzureAgent
id: node-1771869562761
agent:
name: tt
conversationId: =System.ConversationId
input:
messages: ""
output:
autoSend: true
id: ""
name: testing
description: ""
Sticky Notes
STICKY_NOTE: {"id":"sticky_1761166535807_awv9le4bg","text":"Create and connect a /Marketing-Analyst/ agent with following instructions:\n\nYou are a marketing analyst. Given a product description, identify: \nKey features\nTarget audience\nUnique selling points","width":305,"height":260,"x":"118.53985056039915","y":"-273.14943960149435"}
STICKY_NOTE: {"id":"sticky_1761166557820_yn7ggfd41","text":"Create and connect a /Marketing-Copywriter/ agent with following instructions:\n\nYou are a marketing copywriter. Given a block of text describing features, audience, and USPs, compose a compelling marketing copy (like a newsletter section) that highlights these points. Output should be short (around 150 words), output just the copy as a single text block.","width":312,"height":287,"x":"452.8947696139478","y":"-300.8293897882939"}
STICKY_NOTE: {"id":"sticky_1761166563177_yntzuqr31","text":"Create and connect a /Marketing-Editor/ agent with following instructions:\n\nYou are an editor. Given the draft copy, correct grammar, improve clarity, ensure consistent tone, give format and make it polished. Output the final improved copy as a single text block.","width":331,"height":227,"x":"787.7621419676211","y":"-244.8393524283935"}
It is the sequential example but then all but the first agentInvoke removed and then my specific test agent now selected. No other settings have been changed.
The text input I use in the workflow debug screen is exactly the same text I use to test my agent.
Is this some Azure AI foundry bug? Why can't the workflow invoke my agent anymore with its MCP tool? It used to work before, I have successfully ran workflows in the portal, where I still had to manually approve tool calls, but now that doesn't even work anymore either (see test 1)
TLDR:
Agent works with tool call when I just test the agent in the portal. Using that same agent in a workflow results in errors.
Replies:
All reactions