When defining a tool for Claude to use, what information must be provided in the tool definition?
Select an answer to reveal the explanation.
Short Explanation
A tool definition needs three things: a name (what to call it), a description (when/why to use it), and an input_schema (what parameters it accepts). Claude decides whether and how to call it based on these.
Full Explanation
Tool definitions in the Anthropic API require: name, the identifier Claude uses to call the tool; description, which tells Claude what the tool does and when to use it; and input_schema, a JSON Schema defining the parameters Claude should provide, including properties, types, and required fields. An optional cache_control element can be used for prompt caching. The actual function implementation runs in your application; Claude sees the schema, not the code. Saying only the tool name is required is incomplete because Claude needs the description and schema to decide when to call the tool and what arguments to send. Saying the actual Python function code is required is wrong because Claude does not execute or receive the implementation. Saying a sample output is required is wrong because sample output is not part of the required tool definition.