CCDV-F Claude API Mechanics Practice Question
Exhibit
{
"model": "claude-3-5-sonnet-20240620",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "Get the current weather in a location",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}
],
"tool_choice": {"type": "tool", "name": "get_weather"},
"messages": [
{"role": "user", "content": "What is the weather in London?"}
]
}Refer to the exhibit. What is the expected behavior of Claude when receiving this specific API request configuration?
⚠ Common exam trap
Candidates assume the model will use its 'reasoning' to decide whether to call the tool, ignoring that the 'tool_choice' parameter forces execution regardless of the model's actual internal assessment.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Claude will immediately generate a tool_use block for the 'get_weather' tool with 'London' as the location.
The tool_choice parameter allows developers to override Claude's natural decision-making process. By setting it to a specific tool, you force the model to generate a tool-use block for that tool, regardless of whether it thinks it's necessary. This is a powerful mechanic for building rigid workflows where a specific step must always result in a structured function call.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Claude will provide a conversational text response about London's typical weather without using any tools.
Why it's wrong here
Because the tool_choice parameter is explicitly set to force the 'get_weather' tool, Claude is prohibited from giving a purely conversational response. It must attempt to use the specified tool, even if the user's prompt was vague or didn't explicitly ask for a real-time data lookup.
- ✗
Claude will return an error because the user did not provide a specific API key for the weather service.
Why it's wrong here
Claude does not execute tools itself; it only generates the JSON request for the tool. The API key for the weather service is part of the client-side implementation that happens after Claude's response. Therefore, Claude will not error out due to missing third-party credentials during the message generation phase.
- ✗
Claude will bypass the tool and ask the user for more clarification about which part of London they mean.
Why it's wrong here
The 'forced' tool choice mechanic overrides Claude's ability to ask for clarification as its primary output. It will instead attempt to fill the 'location' parameter with the information it has (London) and generate the tool call immediately, as instructed by the tool_choice configuration in the request.
- ✓
Claude will immediately generate a tool_use block for the 'get_weather' tool with 'London' as the location.
Why this is correct
The tool_choice parameter with type 'tool' and a specific name forces Claude to use that exact tool. Since the user mentioned London, Claude will populate the required 'location' parameter in the JSON output, fulfilling the instruction to use the tool as the first and only action.
About these practice questions
This CCDV-F question is part of Courseiva's 257-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCDV-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCDV-F exam.