C.W.K.
Stream
Lesson 03 of 06 · published

Tool Use and Function Calling Are Not Architecture

~9 min · tools, product, framework

Level 0Scout
0 XP0/41 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

What function calling actually is

Function calling (also called tool use) is a learned output format plus an orchestration wrapper. The model is post-trained to emit structured JSON (or some equivalent) when it wants to invoke a tool. An external system parses that output, executes the tool, and feeds the result back as another model input. The model's backbone is unchanged.

The two pieces — neither is architecture

  1. Training the model to emit a structured output format. This is post-training data — examples showing the model when and how to produce tool-call JSON.
  2. An execution layer that runs the tools. This is application code — function dispatchers, sandboxes, API calls, retry logic.

The reasoning + tool combination

Modern reasoning models (o4-mini, Claude with tool use during extended thinking) blur the line by allowing tool calls during the thinking phase. Even this is not architecture — it's a richer post-training format ("you may emit thinking, OR a tool call, OR a final answer at any point") plus orchestration that runs tools mid-thought.

What does change when a model has "good tool use"

  • Post-training data quality and quantity for tool-call examples.
  • How well the model recovers from tool errors and retries.
  • How reliably the model formats tool calls (correct schema, no hallucinated tools).

What does not change

The wiring of the network. Any base model with a chat-completions API and the right post-training can do tool calls. The architecture is unchanged whether tool use is enabled, disabled, or partial.

Code

Tool use under the hood — the model is generating text·python
 1. The model's response when it wants to call a tool:

{"tool": "get_weather", "args": {"city": "Seoul"}}
# That's just text the model emitted. The orchestrator parses it,
# runs the actual function, and feeds the result back as the next turn.

# 2. The orchestrator's job (no model changes here):
def run_tool_call(json_str, tool_registry):
    call = json.loads(json_str)
    return tool_registry[call["tool"]](**call["args"])

External links

Exercise

Open the tool-use docs for any major API (Claude, OpenAI, Gemini). Find the section that describes how tool calls are formatted in the model's output. Note the JSON shape. Then look at any open-weight model's chat template that supports tool use — the format is structurally similar. Tools are a shared output convention, not a hidden architecture.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.