Courseiva
Agents and the Agent SDK →easyMultiple Choice

CCDV-F Agents and the Agent SDK Practice Question

A developer is building a Claude agent with the Anthropic SDK that must look up live order status. The agent has one tool named get_order_status, and its input_schema declares a required string property order_id. During testing, Claude returns a tool_use block with name "get_order_status" and input {"order_id": "A-4471"}. What must the developer's application do next to keep the agent loop running correctly?

⚠ Common exam trap

The trap here is assuming the model executes tools itself, when in fact the client application must run the tool and return a correlated tool_result block.

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

✓

Execute the lookup, then send a user-role message containing a tool_result block with the matching tool_use_id back to Claude.

The agent loop alternates model reasoning with client-side tool execution. When Claude emits a tool_use block, the developer's code runs the named tool and returns the output as a tool_result content block in a user message, keyed by the same tool_use_id. That correlation lets Claude pair the result with its request and produce the final answer using real order data.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Call the tool, then send the raw JSON output as a plain assistant text message so Claude can read the order details directly.

    Why it's wrong here

    Results must be returned in a tool_result block associated with the originating tool_use_id, not as assistant-role prose. Injecting assistant text also forges the model's own turn, which the API rejects as an invalid sequence. Claude cannot reliably correlate free-form text with the pending get_order_status request, so the loop breaks.

  • ✗

    Append Claude's tool_use block to the conversation and immediately call the Messages API again with the same parameters to obtain the final answer.

    Why it's wrong here

    Simply re-invoking the API without supplying a tool_result leaves the model with an unanswered tool request; the loop never receives the order data. The tool_use block is the model's request, not its result. Claude needs the outcome of get_order_status before it can answer, so resubmitting the same request cannot produce a grounded final response.

  • ✗

    Convert the tool_use block into a system message so the model treats the tool request as persistent instructions for the rest of the session.

    Why it's wrong here

    System messages carry instructions and context; they are not the channel for tool execution results. Moving a tool_use block into the system role neither executes get_order_status nor satisfies the model's pending request, and it corrupts the expected message ordering. The tool result must be returned as a tool_result block tied to the tool_use_id.

  • ✓

    Execute the lookup, then send a user-role message containing a tool_result block with the matching tool_use_id back to Claude.

    Why this is correct

    This is the required half of the agent loop: the client executes the tool and returns its output to Claude as a tool_result content block inside a user-role message, with tool_use_id matching the originating tool_use block. Only then can Claude continue reasoning with the real data. This scenario's single tool call maps directly onto that pattern.

About these practice questions

Courseiva writes every CCDV-F question from scratch — 257 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.