Forcing Tool Invocation in Microsoft Foundry Agents
Short answer
D Add the tool_choice parameter to the create_and_process() method call.
Question
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 deterministically force the agent to invoke kbsearch on each run.
What should you do?
Key Takeaways
Tests knowledge of agent execution parameters; the trap is confusing output formatting or thread management with tool selection logic.
This question addresses how to ensure a Microsoft Foundry agent deterministically invokes specific tools like kbsearch. It establishes that the tool_choice parameter is the correct configuration for this requirement.
Common mistake: Learners often select response_format, mistakenly believing it controls which tools are used rather than just the structure of the final output.
Expert Analysis
Why the Answer Is Correct
The core issue is that the agent sometimes relies on its base model's internal knowledge instead of using the provided kbsearch tool. To fix this and ensure grounded citations, you must explicitly instruct the agent to use the tool. The tool_choice parameter allows you to specify exactly which tool(s) the agent should invoke. Setting tool_choice to kbsearch forces the agent to call this tool on every run, satisfying the requirement for deterministic behavior.
Why the Other Options Are Wrong
Option A (response_format) only dictates the format of the response (e.g., JSON vs. text) and does not influence tool selection. Option B (create_thread_and_process_run) changes the concurrency model but does not enforce tool usage. Option C (toolset) defines the available tools but does not force their invocation; without tool_choice, the agent still decides whether to use them.
Community Comment Notes
Community consensus strongly supports option D, with users noting that "The tool_choice parameter lets you explicitly force the agent to use a specific tool." This aligns with standard LLM orchestration patterns where explicit tool forcing is required for grounding.
Exam Strategy
When configuring agents, distinguish between defining capabilities (tools) and enforcing behaviors (tool_choice). If the exam asks for deterministic tool usage, look for parameters that override the model's natural routing decisions.
Frequently Asked Questions
Why doesn't adding the tool to the toolset force its use?
What is the difference between tool_choice and response_format?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
Amelia233 👍 1 Answered DCorrect answer: D. Add the tool_choice parameter to the create_and_process() method call. ✅ The tool_choice parameter lets you explicitly force the agent to use a specific tool. Set it to kbsearch so the knowledge base is invoked on every run, ensuring responses are grounded and include citations. A ❌ response_format controls the output format. B ❌ Changing the processing method doesn't force tool usage. C ❌ toolset makes tools available but doesn't force their invocation. D ✅ tool_choice deterministically selects the required tool.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AI-103 Questions
Access 88 questions with complete answers and detailed explanations.
View Full AI-103 Practice Test →