Function Calling and Tools
"Where is my order 4417?" is the most common question Pedal Point gets. The model cannot know the answer; it lives in the shop's order system, and changes by the hour. RAG helps with documents, but here the assistant needs to do something: look up a live record. That is function calling, also called tool use.
The rule
The model asks for a tool; your code decides and runs it.
You describe each tool to the model: a name, a plain-language description of when to use it, and a schema for its arguments.
{
"name": "get_order_status",
"description": "Look up the shipping status of one order by its number.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"]
}
}When a question needs the tool, the model does not answer in words. It replies with a structured tool call: "call get_order_status with order_id = 4417". The model never runs anything itself. Your code runs the tool, sends back the result, and the model writes the final reply using it.
Some tasks need several tools in sequence. A common pattern, known as ReAct (reason and act), repeats a loop: the model thinks about what it needs, calls a tool, reads the result, and decides the next step, until it can answer. This loop is the heart of what people call AI agents.
Tool descriptions matter as much as prompts. A vague description ("gets data") leads to the wrong tool or wrong arguments. Keep the list short and each tool focused on one job. Every description is sent with each request, so twenty loosely named tools cost tokens and blur the choice, while three clear ones make it easy.