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.

Tool use with the Messages API artwork from Claude Academy

Who this is for

  • AI & ML engineers

    Covers strict tool use, parallel and streaming tool calls, cost control, and Anthropic-hosted tools in the API.

  • Software engineers

    Shows how to build reliable, low-latency tool calls with the Messages API, code execution, web search, and computer use.

What you get out of it

Improve existing Messages API tool implementations with strict schemas, parallel and streamed calls, and lower token costs. This 89-minute course also covers Anthropic-provided tools for code execution, web search, and computer use. It suits developers running production tool workflows.

Outline

Reliable calls

  1. Creating tools that Claude picksLessonWrite tool definitions and descriptions so Claude selects the right tool.
  2. Strict tool use: Stop rejecting your own callsLessonUse strict tool use so tool calls match your schema reliably.

Parallel and streamed tool calls

  1. Parallel tool calling: Cut the latencyLessonRun multiple tool calls in parallel to reduce request latency.
  2. Streaming tool calls: No more frozen spinnersLessonStream tool calls from the Messages API to keep interfaces responsive.

Tools Anthropic provides

  1. Code execution: Claude runs the code it writesLessonLet Claude write and run code using Anthropic's code execution tool.
  2. Web search: Answers from the sites you trustLessonAdd Anthropic's web search tool to pull answers from trusted sites.
  3. Computer use: Automate desktop software with no APILessonAutomate desktop software that has no API using Anthropic's computer use tool.

Costs of tool-heavy requests

  1. Cut the cost of tool-heavy workflowsLessonTechniques for lowering the cost of requests that rely heavily on tools.

Quiz and next steps

  1. Course quizQuizA quiz on reliable tool calls, streaming, built-in tools, and cost.
  2. Start fixing your own toolsLessonApply the course techniques to improve your own Messages API tools.

Details

Details
SourceFormatDuration
Claude AcademyCourse89 min