Option D combines the three key properties of a reliable Claude tool: an explicit contract, clear tool-selection guidance, and controlled execution failure handling. Anthropic's tool documentation defines user tools using a name, detailed description, and JSON input_schema. The description should explain what the tool does, when it should and should not be used, parameter semantics, and relevant limitations. Anthropic emphasizes that precise descriptions materially improve Claude's ability to select the correct tool.
A clear schema prevents ambiguous parameter interpretation and allows validation before calling the external pricing API. Where stronger guarantees are required, Anthropic also supports strict tool use, which constrains generated tool inputs to the declared JSON Schema.
The application's execution layer must also convert pricing-service failures into explicit, handled error paths rather than uncontrolled exceptions. A deprives Claude of critical selection information. B increases malformed-call risk. C delegates infrastructure reliability to the reasoning loop instead of implementing appropriate integration error handling.
Therefore, D represents production-quality custom-tool construction. Relevant Study Guide topics: custom tools, JSON Schema, tool descriptions, validation, external API integration, and error handling.
===============