Your First Simple Tool
Build a calculator tool, define it with JSON Schema in strict mode (strict: true), pass it to Claude, find every tool_use block in the response, and send the result back as a tool_result.
ENМатеріали курсів поки англійською. Інтерфейс, ШІ-наставник і перевірка завдань — українською.
The Problem: Long Arithmetic Without a Tool
A language model produces its answer token by token, so an exact result for long multiplication is not guaranteed without a tool. The classic example from Anthropic's course was recorded on Claude 3 Haiku (that model was retired from the API on April 20, 2026):
Prompt: Multiply 1984135 by 9343116. Only respond with the result
Model answer: 18593367726060
Correct: 18538003464660
Off by about 55 billion
Current models may give a different answer. For calculations where every digit matters (money, taxes, units of measure), it is safer to hand the work to code.
Далі урок відкривається після безкоштовної реєстрації
Реєстрація через email або Google відкриває перші два уроки кожного курсу назавжди і 7 днів повного доступу до всього каталогу. Картка не потрібна.


