Courseiva

CCDV-F Tools and MCP Integration Practice Question

Exhibit

{
  "name": "get_weather",
  "description": "Get the current weather in a given location",
  "input_schema": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "The city and state, e.g. San Francisco, CA"
      },
      "unit": {
        "type": "string",
        "enum": ["celsius", "fahrenheit"]
      }
    },
    "required": ["location"]
  }
}

Refer to the exhibit. A developer provides this tool definition to Claude. If the user asks for the weather in 'London' without specifying a unit, how will Claude's tool_use block be structured based on this JSON schema?

⚠ Common exam trap

Candidates frequently assume that Claude will hallucinate or include optional parameters in the tool use block even when the user completely omits them.

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 will include only the 'location' parameter in the input object.

Claude follows the provided JSON schema strictly when generating tool calls. Since the 'unit' property is not included in the 'required' array, Claude is not obligated to provide it if the user does not specify it. This behavior demonstrates Claude's ability to handle optional parameters while adhering to the structure defined in the tool's input_schema field.

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 will include only the 'location' parameter in the input object.

    Why this is correct

    Because 'unit' is not listed in the 'required' array, the model will omit it if the information is missing from the user's prompt. Claude generates the most concise valid JSON object that satisfies the schema requirements, ensuring that optional fields do not contain hallucinated or default values unless specifically prompted.

  • ✗

    It will fail with a validation error because 'unit' is missing.

    Why it's wrong here

    Validation errors occur during the API request if the schema itself is malformed or if the model produces output that violates the schema. Since 'unit' is optional in this specific definition, the absence of the property is perfectly valid according to standard JSON Schema rules used by the Anthropic API.

  • ✗

    It will prompt the user to choose between 'celsius' and 'fahrenheit' first.

    Why it's wrong here

    While Claude might ask for clarification in a conversational context, if it decides to use a tool and the missing parameter is not required, it will proceed with the tool call using only the available required information. This maintains the flow of execution without unnecessary conversational interruptions for optional tool data.

  • ✗

    It will default the 'unit' to 'celsius' automatically.

    Why it's wrong here

    Claude does not automatically provide default values for optional parameters unless a default is explicitly defined in the JSON schema or instructed in the system prompt. Without an explicit 'default' keyword in the schema, the model will simply leave the optional field out of the generated tool use block.

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.