PM-301e · Module 1

The Tool Use Mental Model

4 min read

Function calling works through the context window. Tool definitions are injected into the context as structured specifications — typically in a system-level block before the conversation. The model reads these specifications and uses them to decide which tool to call, when to call it, and what parameters to pass. The model does not have special tool-calling abilities beyond text generation — it generates a structured response that the API interprets as a tool invocation.

Practical consequence: the model selects tools based on the information in the context at the time of selection. If the tool description is unclear, the model selects the tool incorrectly. If the tool description overlaps with another tool, the model selects ambiguously. If the task prompt does not indicate that tool use is appropriate, the model may not use tools at all. The quality of tool selection is entirely determined by the quality of the specifications you provide.

  1. What Happens During a Tool Call Step 1: Model generates a tool invocation in structured format (name + parameters). Step 2: API intercepts the invocation and routes to your function. Step 3: Your function executes and returns a result. Step 4: Result is injected back into the context as a tool result. Step 5: Model generates its next response with the tool result available.
  2. The Tool Definition as Specification The tool definition has three parts: name (how the model invokes it), description (when and why to use it), and input schema (what parameters to provide). All three are specifications the model reasons from. Treat them with the same rigor as any other prompt component.
  3. Parallel vs. Sequential Tool Calls Some APIs support parallel tool calling — the model can invoke multiple tools simultaneously. This reduces latency for independent operations. Sequential tool calls are appropriate when the output of one tool is required as input to the next. Know which mode your API supports and prompt accordingly.