Tool use (function calling) allows LLMs to request execution of defined functions with structured JSON arguments. The model outputs a tool_call object instead of text; the application executes the function and returns the result. Tool schema design is critical: clear descriptions, typed parameters, and example values guide the model. Parallel tool calls enable concurrent execution. Strict mode (OpenAI) enforces JSON Schema compliance in tool arguments.
LLMs can request multiple tool calls in parallel.
The description field in your tool schema is read by the LLM to decide when and how to call the tool. Write it like documentation: "Searches the web for current information. Use when the user asks about recent events."
When the LLM returns multiple tool calls, execute them with Promise.all() or Task.WhenAll(). Sequential execution wastes time — parallel calls can reduce latency by 3-5x.
Tool errors should flow back as tool result messages so the LLM can self-correct. Only crash or escalate to the user if max retries are exceeded.
Sign in to share your feedback and join the discussion.