Courseiva
Claude API Mechanics →hardMultiple Choice

CCDV-F Claude API Mechanics Practice Question

A developer's agent calls the Messages API with several custom tools defined. During testing, the response repeatedly returns stop_reason "tool_use" with a tool_use block, but the application crashes because it expects a text block. The developer wants to handle this correctly so the agent can continue. What should the application do when it receives stop_reason "tool_use"?

⚠ Common exam trap

The trap here is treating stop_reason "tool_use" as an error to retry rather than a request for the application to execute a tool and return its result.

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

✓

Parse the tool_use block, execute the tool, then send a new request containing the assistant's tool_use turn and a user turn with the corresponding tool_result block.

A tool_use stop reason means the model has deliberately halted to request external execution. The application must run the named tool with the provided input, then continue the conversation by appending the assistant's tool_use turn followed by a user turn carrying the matching tool_result block. Only after receiving that result will the model resume and produce its final answer.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Set tool_choice to "none" and resend the request so Claude answers directly without invoking tools.

    Why it's wrong here

    Forcing tool_choice to none would suppress the tool the model needs and produce a degraded answer, defeating the agent's purpose. It also discards the model's intent. The right response is to satisfy the tool call and return its result, not to disable tools mid-conversation.

  • ✗

    Resend the original request with the same parameters, because a tool_use stop reason indicates a transient server condition.

    Why it's wrong here

    A tool_use stop reason is a deliberate protocol signal, not an error or transient condition. Resending the identical request will produce another tool_use block and loop indefinitely. The application must instead supply the tool result so the model can proceed. Retrying without new information wastes tokens and never advances the conversation.

  • ✗

    Ignore the tool_use block and read the accompanying text field, since Claude always includes a natural-language summary alongside tool calls.

    Why it's wrong here

    When the model decides to call a tool, the response content consists of a tool_use block and does not guarantee a text block. Assuming a text field exists leads to parsing failures. The application must branch on the content block type rather than expecting prose alongside every tool invocation.

  • ✓

    Parse the tool_use block, execute the tool, then send a new request containing the assistant's tool_use turn and a user turn with the corresponding tool_result block.

    Why this is correct

    When stop_reason is tool_use, the model has paused and is waiting for tool output. The correct loop is to execute the requested tool and return the result as a tool_result content block in a user turn, preserving the assistant's tool_use turn first. This lets the model continue reasoning with the result.

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 →

How Courseiva writes practice questions · Editorial policy

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.