Courseiva
Using the Claude API →hardMultiple Choice

CCAO-F Using the Claude API Practice Question

Exhibit

{
  "model": "claude-3-5-sonnet-20240620",
  "max_tokens": 1024,
  "messages": [
    {"role": "user", "content": "What is the weather in London?"}
  ],
  "tools": [
    {
      "name": "get_weather",
      "description": "Get weather for a location",
      "input_schema": {
        "type": "object",
        "properties": {
          "location": {"type": "string"}
        }
      }
    }
  ],
  "tool_choice": {"type": "tool", "name": "get_weather"}
}

Refer to the exhibit. What is the specific effect of the 'tool_choice' parameter as configured in this request?

⚠ Common exam trap

Candidates often mistake 'tool_choice' for a general suggestion, not realizing that 'tool_choice: {type: "tool", name: "..."}' forces the model to use that specific tool.

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

✓

It forces Claude to use the 'get_weather' tool specifically.

The 'tool_choice' parameter allows developers to control Claude's tool-calling behavior. By setting it to type 'tool' and specifying a 'name', the developer is forcing Claude to use that specific tool, even if it thinks it could answer without it. This is useful for specialized workflows where a specific function must always be executed as the next step in the application logic.

Answer analysis

Option-by-option breakdown

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

  • ✗

    It allows Claude to choose between using the tool or answering normally.

    Why it's wrong here

    This describes the 'auto' setting (the default). When 'tool_choice' is set to a specific tool name, the model no longer has the option to ignore the tool; it is strictly required to generate a tool call for that specific tool, bypassing the model's own decision-making process.

  • ✓

    It forces Claude to use the 'get_weather' tool specifically.

    Why this is correct

    By explicitly naming the tool in the tool_choice object, the developer overrides the model's default behavior. Claude will be compelled to generate a tool_use block for 'get_weather', ensuring that the application receives the structured data it needs to proceed with the weather-related logic, regardless of the prompt's phrasing.

  • ✗

    It prevents Claude from using any tools during this request.

    Why it's wrong here

    To prevent Claude from using any tools, the developer would set 'tool_choice' to type 'none' (or simply not provide any tools). Explicitly naming a tool in the 'tool_choice' parameter has the opposite effect, as it mandates the use of the specified tool rather than disabling tool functionality.

  • ✗

    It enables Claude to use multiple tools in a single response.

    Why it's wrong here

    Claude can naturally use multiple tools if 'auto' is enabled and the prompt requires it. However, the configuration in the exhibit actually limits Claude to just the 'get_weather' tool. Specifying a single tool in 'tool_choice' restricts the model to that one tool, rather than expanding its ability to use many.

About these practice questions

One of 259 original CCAO-F practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 CCAO-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 CCAO-F exam.