Tool calling

Step 2 of 8 in Agentic AI · Build · Easy

The model outputs a structured request to call a function; your code runs it and returns the result.

Build it

  1. Two tools

    Calculator and weather-stub tools via an LLM API; handle the tool call and return results.

    Done when: Model answers '17% of 2,340' using the calculator.

Case study: Toolformer (2023)

  • A model taught itself when to call a calculator, search or calendar.
  • Kept a call only if it made the next tokens more predictable.
  • Showed tool use can be learned rather than hand-prompted.

Read the case study

Resources

Earn this star

On the map, you log what you built. Finish the step and its star lights.

Open this step on the map