Share via

How to fix Connected Agent fails to invoke connected agent with MCP server in Azure AI Foundry?

Robin Ganpat 0 Reputation points
2025-10-01T07:24:23.3833333+00:00

Bug description

I have two agents deployed in Azure AI Foundry (Switzerland North), both using a shared GPT-4.1 model deployment:

Agent 1: apples-agent Has an MCP server configured The MCP server exposes one tool: returns the number of apples in my basket Works correctly when invoked directly - returns expected results

Agent 2: orchestrator-agent Has the apples-agent configured as a Connected Agent Instruction: "Use the apples-agent when the user wants to know the amount of apples in the basket" Intended to act as an orchestrator that delegates tasks to other agents

The Problem

When I ask the orchestrator-agent "How many apples are in my basket?", the request consistently times out after 60+ seconds and fails, both in the Azure AI Foundry Agents Playground and when using the .NET SDK. However, when I ask the apples-agent directly the same question, it works perfectly and returns the correct result immediately using its MCP server. The issue only occurs when trying to invoke the apples-agent through the orchestrator-agent via the Connected Agents feature.

Expected behavior

When a user asks the orchestrator-agent about the number of apples in the basket:

  1. The orchestrator-agent should recognize the query matches its instruction to delegate to apples-agent
  2. The orchestrator-agent should successfully invoke the apples-agent
  3. The apples-agent should use its MCP server to call the tool and retrieve the apple count
  4. The result should be returned through the orchestrator-agent to the user
  5. Total response time should be reasonable (under 10-15 seconds)

Actual behavior

In Azure AI Foundry Playground:

  • Query is sent to orchestrator-agent
  • UI displays "Looking for references using..." message
  • Request hangs for 60+ seconds
  • Eventually displays error message: "Error: There was a problem with the request. Please try again."
  • No result is returned

Using .NET SDK (Azure.AI.Agents.Persistent 1.2.0-beta.5):

  • Request times out after 60+ seconds
  • Response indicates inability to connect to the apples-agent
  • Error suggests connection or invocation failure

Direct invocation (baseline for comparison):

  • Querying apples-agent directly returns correct results immediately
  • MCP server tool invocation works as expected

Reproduction Steps

Setup:

  1. Deploy GPT-4.1 model in Azure AI Foundry (Switzerland North)
  2. Create Agent 1 (apples-agent):
    • Configure with GPT-4.1 model
    • Add MCP server with one tool: "Get number of apples in basket"
    • Verify tool works by testing directly in playground
  3. Create Agent 2 (orchestrator-agent):
    • Configure with GPT-4.1 model
    • Add apples-agent as a Connected Agent
    • Add instruction: "Use the apples-agent when the user wants to know the amount of apples in the basket"

Reproduce the issue:

Azure AI Foundry Playground:

  1. Navigate to orchestrator-agent in the Agents Playground
  2. Send message: "How many apples are in my basket?"
  3. Observe "Looking for references using..." message
  4. Wait 60+ seconds
  5. Observe timeout/failure

Verification that target agent works:

  1. Navigate to apples-agent directly in the playground
  2. Send message: "How many apples are in my basket?"
  3. Observe immediate successful response with correct apple count

Additional context

  • Both agents deployed in same region (Switzerland North)
  • No network restrictions or custom firewall rules
  • Issue occurs consistently (100% reproduction rate)
  • No special authentication or permissions configured beyond defaults

My questions

  1. Is there a known issue with Connected Agents invoking agents that have MCP servers configured?
  2. Are there timeout settings that need to be adjusted for agent-to-agent calls?
  3. What diagnostic logging can be enabled to trace the Connected Agent invocation flow?
  4. Are there specific configuration requirements or limitations for this scenario?
Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments

6 answers

Sort by: Most helpful
  1. Ashwani kumarsahu 0 Reputation points
    2025-11-07T15:12:41.23+00:00

    🧠 Azure AI Foundry में Connected Agent की समस्या

    ❌ समस्या: create_agent() API में run_handler विकल्प नहीं है

    ✅ समाधान: API को अपडेट करना होगा या वर्कअराउंड खोजना होगा

    💬 Microsoft Q&A पर सुझाव मिला:

    "There is no run_handler option for create_agent(). Your team should rework the API to add that option."

    📌 अगर आप Azure AI Foundry पर काम कर रहे हैं, तो यह जानकारी ज़रूरी है!

    Was this answer helpful?


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Anshika Varshney 12,775 Reputation points Microsoft External Staff Moderator
    2025-10-06T19:30:50.16+00:00

    Hello Robin Ganpat,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    From your description, the apples-agent works fine when called directly, so the MCP server and tool are working correctly. The timeout issue happens only when the orchestrator-agent tries to call the apples-agent via Connected Agents. This usually happens because agent-to-agent calls with MCP tools can add extra latency, and the default 60-second timeout is often exceeded.

    A few things to check, make sure the orchestrator-agent instruction clearly matches the query, confirm that Connected Agent permissions are properly set, and consider increasing the timeout for agent-to-agent calls. Enabling debug or verbose logging in the Foundry Playground or .NET SDK can also help trace where the request is failing.

    If the issue persists, a temporary workaround is for the client to call the apples-agent directly instead of routing through the orchestrator-agent, which avoids the timeout. In most cases, adjusting timeouts and reviewing logs resolves this problem.

    If you feel that your quires have been resolved, please accept the answer by clicking the "Upvote" and "Accept Answer" on the post.

    Thankyou!

    Was this answer helpful?


  5. Alex Burlachenko 21,805 Reputation points MVP Volunteer Moderator
    2025-10-01T09:28:24.5233333+00:00

    Hey Robin,

    this is a complex and fascinating agent to agent communication issue )) you have set up a perfect test case, and the fact that the apples agent works alone but fails when called by the orchestrator points directly to a problem in the connected agent handoff. this sounds like a potential timeout or configuration bug in the ai foundry platform itself, especially since it is 100 percent reproducible. the 60 second hang is a classic sign of an internal timeout being hit.

    you should check the activity logs and diagnostic settings for your ai foundry project. enable all possible logging and traces for both agents. look for any error messages that occur when the orchestrator tries to invoke the apples agent. the logs might show a permission denied error, a network resolution failure, or a protocol mismatch that is not visible in the playground ui.

    look at the identity and authentication between the two agents. even though you are using the default settings, the orchestrator agent might need explicit permission to call the apples agent. check if there is a managed identity associated with each agent and whether the orchestrator's identity has the 'ai foundry agent user' role on the apples agent resource.

    try creating a third, very basic agent with no mcp server. set the orchestrator to call this simple agent instead. if that works, it confirms the issue is specific to invoking an agent that has an mcp server. if it also fails, then the problem is with the connected agent feature in general.

    given the complexity, your most effective step is to open a support ticket with microsoft. this is a deep platform integration issue. provide them with your detailed reproduction steps, the agent names, your region, and the exact timestamps of your tests. the backend engineers can look at the service logs for the agent to agent call and identify where the invocation is breaking down.

    enable detailed logging to capture the failure, check the managed identity permissions between agents, and then contact azure support with all your evidence. this is likely an issue that only the product team can resolve.

    rgds,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.