Roles Beyond the Basics

Roles

Part of: Chat Roles & Messages

The first chatbots had three roles and that was the whole story. Then assistants started doing things, checking the weather, querying a database, running code, and three roles weren't enough. How does the model see the result of a database query it asked for? A new kind of message: the tool result . Once you add it, a transcript stops being a chat and becomes a record of an agent at work. What it is Beyond system, user, and assistant, modern chat APIs add a tool role (sometimes called tool or function). It carries the result of a tool the assistant asked to call . The flow goes: the assistant emits a request to call a tool, your code runs that tool, and you feed the output back as a tool-role message so the model can read it on the next turn. Many APIs also allow an optional name field on a message, used to label which tool or which participant a message came from when several are in play. How it works A tool-augmented transcript interleaves an extra role. The assistant says "call get weather," your code runs it, and you append a tool message with the answer: The key point: a tool result is just another message in the same ordered list. The model can't run tools itself, it only emi

Challenge: Tool-Call Matcher