-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
AI ProjectsService AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
Environment
- azure-ai-projects SDK version: >=2.0.0b1
- Python version: 3.x
- Date observed: January 2026
Description
When invoking an agent with MCP tools as the second step in a declarative YAML workflow, the workflow fails with an error indicating a type mismatch between Object and Array.
Error Message
Unhandled workflow failure - #validateuser_agent (InvokeAzureAgent) ->
The requested operation requires an element of type 'Object', but the target element has type 'Array'.
Steps to Reproduce
- Create a prompt agent without MCP tools (Agent A)
- Create a prompt agent with MCP tools (Agent B)
- Create a sequential YAML workflow that invokes Agent A, then Agent B
- Run the workflow
Expected Behavior
Both agents execute successfully in sequence.
Actual Behavior
- Agent A completes successfully
- Agent B fails immediately with the type mismatch error
- The error occurs regardless of input format (text, messages, static text)
Workaround Verified
Using the same agent (without MCP) twice in sequence works correctly, confirming the workflow syntax is valid.
Minimal Reproduction Code
from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import WorkflowAgentDefinition
from azure.identity import DefaultAzureCredential
workflow_yaml = """
kind: workflow
trigger:
kind: OnConversationStart
id: sequential_workflow
actions:
- kind: CreateConversation
id: create_conversation
conversationId: Local.ConversationId
- kind: InvokeAzureAgent
id: agent_no_mcp
conversationId: "=Local.ConversationId"
agent:
name: AgentWithoutMCP
input:
text: "=System.LastMessageText"
- kind: InvokeAzureAgent
id: agent_with_mcp
conversationId: "=Local.ConversationId"
agent:
name: AgentWithMCPTools # <-- This fails
input:
text: "Process the above."
- kind: EndConversation
id: end
"""
# Create and run workflow
with DefaultAzureCredential() as credential:
with AIProjectClient(endpoint=endpoint, credential=credential) as client:
workflow = client.agents.create_version(
agent_name="test-workflow",
definition=WorkflowAgentDefinition(workflow=workflow_yaml),
)
# Run workflow - second agent failsAdditional Context
- The MCP agent works correctly when invoked standalone
- The MCP agent works correctly when invoked as the first (and only) agent in a workflow
- The issue only occurs when MCP agent is invoked after another agent in a sequential workflow
Metadata
Metadata
Assignees
Labels
AI ProjectsService AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that