0
0
Agentic AIml~20 mins

Tool selection by the agent in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Agent Tool Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
How does an agent decide which tool to use?

An agent has multiple tools available to solve a problem. What is the main factor it uses to select the best tool?

AThe tool with the most complex internal architecture
BThe tool with the fastest response time regardless of accuracy
CThe tool that was used most recently
DThe tool that best matches the current task requirements and context
Attempts:
2 left
💡 Hint

Think about what helps the agent solve the problem correctly, not just quickly or by habit.

Predict Output
intermediate
1:00remaining
Output of tool selection code snippet

What is the output of this Python code simulating an agent choosing a tool?

Agentic AI
tools = {'search': 0.8, 'calculator': 0.9, 'translator': 0.7}
selected_tool = max(tools, key=tools.get)
print(selected_tool)
A"search"
B"translator"
C"calculator"
DKeyError
Attempts:
2 left
💡 Hint

Look for the tool with the highest value in the dictionary.

Hyperparameter
advanced
1:30remaining
Choosing the right confidence threshold for tool selection

An agent uses confidence scores to pick tools. What happens if the confidence threshold is set too high?

AThe agent rarely selects any tool, possibly failing to act
BThe agent selects tools more often, increasing speed but risking errors
CThe agent ignores confidence and picks tools randomly
DThe agent always picks the tool with the lowest confidence
Attempts:
2 left
💡 Hint

Think about what happens if the agent demands very high confidence before using a tool.

Metrics
advanced
1:30remaining
Evaluating agent tool selection accuracy

An agent selects tools for tasks. Which metric best measures how often the agent picks the correct tool?

AAccuracy
BRecall
CPrecision
DF1 Score
Attempts:
2 left
💡 Hint

Consider the metric that measures overall correct selections out of all attempts.

🔧 Debug
expert
2:00remaining
Debugging tool selection logic error

What error does this code produce when the agent tries to select a tool?

tools = {'search': 0.8, 'calculator': 0.9, 'translator': 0.7}
threshold = 0.95
selected_tool = None
for tool, score in tools.items():
    if score > threshold:
        selected_tool = tool
print(selected_tool.upper())
AKeyError because 'upper' is not a dict key
BAttributeError because selected_tool can be None
CTypeError because score is a float
DNo error, prints 'CALCULATOR'
Attempts:
2 left
💡 Hint

What if no tool meets the threshold? What happens when calling upper() on None?