Building Agents
Build Your First Tool-Using Agent
A framework-neutral path from one narrow goal to a controlled agent loop with a real tool.
Choose one verifiable job
Start with a task that has a clear finish, such as finding an order and explaining its current status. Define what success looks like and which cases must be handed to a person.
Add one narrow tool
Expose a read-only function with a small typed schema and representative error messages. Give the model enough description to know when to call it, but keep authorization and validation in code.
Run and evaluate the loop
Pass the goal and tool definition to the model, execute valid calls, and return observations until it answers or reaches a limit. Test normal, ambiguous, missing-data, and malicious inputs before adding more tools.