GuidesAI agents
Tool use: how an AI acts in your systems
The loop
- DescriptionName, role and parameters of each tool.
- RequestThe model returns a structured call.
- ExecutionYour code checks, then runs it.
- ResultSent back to the model, which answers or calls again.
An example
The user asks: “Where is my order 4521?”. The model does not know the order. It returns a get_order call with order_id: 4521. Your code reads the database, returns the status, and the model writes the answer.
Safety rules
- Check parametersThe model proposes, the code validates: type, format, user permissions.
- Separate read and writeTools that change data require a confirmation.
- Cap the loopA maximum number of calls per request.
- Log everythingWhich tool, which parameters, which result.
To share your tools across assistants, see the MCP server. For the step to agents, AI agents on real data.
Frequently asked questions
- Are function calling and tool use the same thing?
- Yes. Providers use one name or the other for the same mechanism.
- Can the model call several tools?
- Yes, one after another or in parallel. The application loops as long as it requests tools, with a capped number of steps.
- How does it relate to MCP?
- MCP standardises how tools are described and served, so one server works with several assistants. The calling mechanism stays the same.