Tool use
The model asks for a named function with arguments, the program runs it and hands back the result, so the model can act instead of only describing.
Each tool is declared with a name, a description, and the shape of its arguments. The model does not run anything itself: it produces a request, your code decides whether to honour it, and the result comes back as another message.
Two things decide whether this works in practice. The description has to say when the tool should be used, not only what it does, and the result has to be small enough to read: a tool that returns a whole file spends the context window that the rest of the task needs.