You have a Microsoft Foundry project that contains an agent. The agent has a Model Context Protocol (MCP) tool that queries a knowledge base stored in Azure AI Search. Some agent runs return answers from the base model without invoking the knowledge base, which results in responses without grounded citations. You are provided with the following code snippet that runs the agent. You need to add the correct tool _choice parameter to the code to deterministically force the agent to invoke the MCP tool on each run. What should you add?

Select an option, then click Submit answer.
Reference / correct answer:
tool_choice ={“type”:“mcp”}
Most accepted answer: D. tool_choice ={“type”:“mcp”}
Community votes: A=3, D=4
Selected Answer: D D is more precise. required only forces the use of some tool, while {"type":"mcp"} explicitly forces the MCP tool. Also, option A uses incorrect Python syntax. upvoted 1 times
Selected Answer: A Its not D. Its A. The question says:"force the agent to invoke the MCP tool on each run" The documented behavior of tool_choice="required" is: Force the model to call a tool instead of answering directly. That directly addresses the problem statement: Some runs return answers from the base model without invoking the knowledge base. D. tool_choice={"type":"mcp"} MCP is the tool protocol, not the standard tool_choice value used to force invocation. Simply specifying "mcp" does not represent the documented way to require tool use. upvoted 1 times
Selected Answer: A tool_choice("required") forces the agent to invoke a tool every time. Since the MCP tool is the only applicable tool, the agent will use it on every run, ensuring grounded responses with citations instead of answering from the base model. upvoted 1 times
Selected Answer: D Its D. Question Clearly state " add the correct tool _choice parameter to the code to deterministically force the agent to invoke the MCP tool on each run" in that case, we can't say "required" , becuase if you have more than one tool , its not valid. So answer is D upvoted 1 times
Selected Answer: D Its D because tool_choice="required" only forces it to use a tool its not speficifed if the agent has other tools . Then you have to force that SPECIFIC tool upvoted 1 times