Azure AI Agents: Getting error when creating and processing new run

ALEJANDRO OSORIO-CUESTA 10 Reputation points
2025-08-08T15:25:32.5266667+00:00

Hi,
I'm currently working on a multi-agent solution and for every message sent to the main agent getting Assistant tool call depth exceeded error:

{	
	'code': 'tool_server_error',
	'message': 'Error: tool_user_error; Error: assistant_tool_depth_exceeded; Assistant tool call depth exceeded'
}

multi-agent solution

Can you please provide details about the assistant_tool_depth default value and suggest how to increase?

Thanks.

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 22,576 Reputation points Volunteer Moderator
    2025-08-10T13:20:21.91+00:00

    Hello ALEJANDRO OSORIO-CUESTA,

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

    I understand you are having the assistant_tool_depth_exceeded error while working with Azure AI Agents.

    This issue arises because Azure AI Agents enforce a default limit of 5 nested tool calls per run, which is not configurable through the SDK or environment variables. When your agent architecture involves recursive or deeply nested tool invocations such as one agent calling another that then calls a tool you may exceed this depth, triggering the error. This is a common challenge in multi-agent orchestration scenarios where agents are designed to collaborate or delegate tasks.

    To address this, the first step is to confirm the depth limit. According to the error you posted, the default depth is indeed 5, and currently, there's no direct way to increase it via configuration. If your use case requires deeper nesting, the recommended approach is to submit a quota increase request through Azure Support. Be sure to include your subscription ID, a brief overview of your agent architecture, and a justification for needing a higher depth limit.

    However, a more sustainable solution is to optimize your agent orchestration. Microsoft recommends using concurrent orchestration patterns, where agents operate in parallel rather than sequentially, to avoid unnecessary depth. You can also explore group chat orchestration, where agents share context and collaborate without chaining tool calls. These patterns are detailed in the https://learn.microsoft.com/en-us/azure/architecture/ai-ml/guide/ai-agent-design-patterns

    Additionally, if you're following tutorials like the - https://github.com/tayganr/azure-ai-agent-lab/blob/main/tutorials/05-multi-tool-agent.md - make sure that your tools are initialized independently and avoid chaining create_and_process_run() inside another agent’s tool logic. This kind of recursive setup is a common cause of depth errors. Also, refer to - https://github.com/microsoft/semantic-kernel/issues/10287 for community discussions on similar problems and architectural suggestions.

    In summary, while the error is rooted in a system-imposed depth limit, the best path forward involves a combination of architectural refactoring and, if absolutely necessary, a formal support request to increase the limit.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

Your answer

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