Issue 13 · Nov 2–8, 2026Editions · Glossary · Archive · Method · RSS · HU / ENG

News of the AI era, curated weekly

Glossary › Developer basics

function

basicwidespread

A function is a reusable, named part of a program that performs a well-defined task and usually returns a result.

In plain terms

Imagine a function as a recipe in the kitchen. The recipe has a name (for example, 'pancake batter'), specifies the required ingredients, and always yields the same type of result. You do not need to figure it out anew each time; it is enough to say, 'make the pancake batter for four people.'

Programmers break software into functions so they do not have to write the same operation a hundred times. If the step that calculates the gross price from the net price lives in a single function, then fixing a bug or changing a VAT rate has to be made in only one place.

In the AI world, the word has gained new significance. A language model alone only writes text, but functions are its 'hands': through them, an agent can query the weather, send emails, or search a database. This is called function calling or tool use.

How it works

  1. The developer writes the function: gives it a name, specifies what input data (parameters) it expects, and describes the steps to be executed.
  2. At other points in the program, the function is called by its name and passed specific values, such as a price of 10,000 forints and a VAT rate of 27 percent.
  3. The function executes its own steps, can even call other functions in the process, and then returns the result (return value) to where it was called from.
  4. The program continues from where it left off before the call and proceeds using the received result.
  5. In the case of an AI agent, the developer pre-defines which functions are available. The model only indicates which one it requests and with what data; the actual execution is performed by the surrounding program, which returns the result to the model.

An everyday example

When you type =SUM(A1:A10) in Excel, you call a function: you specify the cells, and you get their sum back. Something similar happens when you ask a chat AI about tomorrow's weather and the AI is connected to a weather-query tool. In this case, this function runs in the background, and the AI formulates the answer based on its result.

Who is affected

developerThe function is the basic unit of daily work: programs are built from it, and it is tested, fixed, and reused. → Code
employeeIf you use a spreadsheet or create small automations with a coding agent, you are working with functions, even if you do not call them that. → Work & HR
entrepreneur, executiveWhat an AI agent can do within your company is determined by the set of functions made available to it.
parent, student, teacherIn programming education, this is one of the first concepts; it is related to but not identical to the function taught in math class. → Education & Family

A common misconception

MythMany believe that during a function call, the AI model itself executes the operation, for example, sending the email.
In realityThe model only writes a request describing which function should be run with what data. Execution is the job of the surrounding software, which also decides whether to grant the request.

Limits and risks

Similar, but not the same

Related concepts

Broader

programming, source code, szoftver

Narrower

function calling, parameter, return value, method, recursion

On the edge

API, tool use, algorithm, variable, library

A brief history

The word moved from mathematics into programming. The idea of reusable program parts (subroutines) dates back to the late 1940s. The first practical solutions were developed for the British EDSAC computer. The second version of the FORTRAN language, in 1958, already let programmers write their own functions and subroutines. The function-calling capability of language models became widely available in 2023.

Where things stand

The function is a basic element of practically every programming language. By the end of 2026, it had also become standard practice for AI agents to carry out tasks through functions, that is, tools.

Status: 2026 November

In the news

Appears in 38 Agent Age stories; the curve shows weekly occurrence in the news magazine.

Also known as

function · function · function · szubrutin · procedure · method · function calling · function calling

Sources

This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.