Stage 2 · Teens · Working with LLMs

Tool Use

How models request functions and consume results instead of guessing.

Structured output becomes tool use when the schema means "call this function." Modern LLMs can be given a list of tools (functions) with defined names, descriptions, and input schemas. Instead of only producing prose, the model emits a structured request to call one of them — the harness (the application code around the model) executes it and feeds the result back.

This is the mechanism that turns a plain chatbot into something that can search the web, run code, query a database, or take real actions. The next track (Agents) is about looping that mechanism; the Harnesses track is about the scaffolding that makes it safe. This lesson is the single request/response cycle.

Anatomy of a Tool Call
"Should I bring a jacket to Austin today?"
1. Model requests a tool call
{
  "type": "tool_use",
  "name": "get_weather",
  "input": {
    "location": "Austin, TX",
    "unit": "fahrenheit"
  }
}
→
2. Harness runs it, returns result
{
  "type": "tool_result",
  "content": "72°F, partly cloudy, wind 8mph"
}
The model never touches the weather API directly — it only ever emits the structured request on the left. The harness executes it and hands back the result on the right as new context.
User asks: "Should I bring a jacket to Austin today?"

Step through a full tool-call request/response cycle.

All lessons in Stage 2: How AI works