Function calling
A language model requests a described function with structured arguments; the connected application executes it.
How does function calling work?
Function calling connects a language model to described functions. The model can output a function name and corresponding structured arguments. The connected application performs the execution and may return the result to the model for the subsequent response. The integration must define which functions are available and under what conditions they may run. A correctly formatted call establishes neither authority for the action nor the factual accuracy of its arguments.
In a fictional warehouse assistant, the function get_stock queries inventory. The parameter item_code is intended to identify the item P-73. Before the query, the application checks whether the item code is valid and whether the requester may view that stock. The assistant bases its answer on the actual result. If the service is unavailable, the process needs an appropriate error state. Reading a stock quantity does not reserve goods; that would require a separate authorised action with a confirmed result. The team therefore also plans checks for invalid items and missing access rights.
Sources
Related terms
- AI agentAn AI system that selects its next steps within defined limits and uses tool results to guide further work.
- Agentic workflowA process combining AI-assisted decisions and tool actions, with fixed checks and variable paths through the work.
- Model Context ProtocolMCP standardises exchanges between AI applications and servers providing tools, context data or templates.
- AI guardrailsGuardrails constrain and check AI application behaviour. Model instructions and technical enforcement perform different tasks.
- Prompt injectionPrompt injection attempts to redirect an AI application through inserted instructions. Retrieved documents can contain them too.
- Model cardA model card documents an AI model’s purpose, foundations, evaluation conditions and known limitations for a particular version.
Articles on this topic








AI & Automation with ASES
AI assistants and automated workflows



