SteelReed

Search

Search posts, questions…

AI & LLMQuestion 1 / 25

Junior

How does function calling (tool calling) work, and who actually executes the tool?

Short answer

The model executes nothing: it only returns a tool-call proposal (name + arguments). Your application code decides whether to run it, runs it, sends the result back, and loops until the model finishes answering.

ModelApplicationModelApplicationQuestion + tool definitionsProposed tool_callsCheck permissions,run toolTool resultFinal answer

3 points to say:

  1. The model only returns tool_calls; the application is the one calling APIs. An agent is that loop with many self-chosen steps.
  2. Tool descriptions decide which tool the model picks and how it fills the arguments.
  3. Permissions, argument checks, idempotency, audit all live in the tool code, not in the prompt.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.