Loading

Tool use with the Messages API

Take tool use that already works and make it reliable, responsive, and cheaper to run, then add the tools Anthropic provides.

9 lessons1.5 hr1 quizCompletion badge
What you’ll learnBy the end of this course, you’ll be able to
  • Write tool descriptions that tell Claude when to use each tool
  • Turn on strict tool use so Claude's tool input matches your JSON schema
  • Run the tool calls in one response at the same time with parallel tool use
  • Use streaming to show which tool Claude chose as soon as its name arrives
  • Add the code execution tool so Claude runs Python on files you upload with the Files API
  • Give Claude the web search tool, limited to the sites you choose
  • Use computer use to let Claude operate a desktop app through your program
  • Cut the cost of input tokens with prompt caching and programmatic tool calling

This course fixes the problems that show up once basic tool use works. For example, Claude picks the wrong tool, your backend rejects a call, a spinner freezes, or input tokens grow with every tool result.

The course fixes one problem at a time, in order, across eight main lessons. Most open with a short video, and each shows how Meridian, a fictional engineering consultancy, fixed one problem. You write no code on the page, so you apply each fix to your own tools afterwards. You walk away knowing which fix fits which problem. Pass the graded quiz to earn your completion badge.

Who this course is for

This course is for you if tool use already works in your code. Claude calls a tool you defined, your code runs it, and the result returns to Claude. The course doesn't teach that first round trip.

Prerequisites

If you haven't written the tool loop by hand at least once, take Claude Platform 101 first. The code uses the Python SDK, and some lessons also show JSON. Reading both is enough. To try a technique yourself, you need an API key from a Claude Console account. Trying computer use also takes a desktop in a container and your own code to drive it.