How it works
You describe each tool with a name, a plain-language description and a JSON Schema for its inputs. Instead of answering, the model can reply with a request such as get_order_status with order_id 1042. Your code runs the function, sends the result back and the model continues, possibly calling more tools, until it can give a final answer. The model never runs anything itself: your code decides what actually executes.
An agent wraps this in a loop with a goal, a budget and a stopping rule, and may plan, browse, write code or hand work to other agents. Agents fail in new ways: they can loop, run up token bills, act on a misunderstanding, or follow instructions hidden in a web page or email (prompt injection). Keep tools narrow, require confirmation for anything destructive or costly, log every step and cap the number of turns.
Related terms
More in AI and LLMs
Building with models