Function Calling (Tool Use)
Function calling, or tool use, lets a language model request that an application run a defined function, such as a database query or API call, by outputting a structured call with arguments; the application executes it and returns the result.
The developer describes each available function with a name, purpose and parameter schema, usually in JSON Schema. When the model decides a function is needed, it outputs the function name and arguments in a structured format instead of plain text. The application validates the arguments, executes the call and passes the result back to the model, which uses it to continue or answer. The model itself does not execute anything.
Function calling is the basic mechanism behind AI agents and assistants that check order status, look up sensor values, create tickets, run calculations or search documents. It turns free-form requests into structured actions, and structured output modes use the same idea to make models return data that matches a schema.
Models can choose the wrong tool, supply invalid or malicious arguments, or be steered by prompt injection, so applications must validate inputs, enforce permissions, require confirmation for consequential actions and log calls. Write operations need particular care. Protocols such as the Model Context Protocol standardise how tools are exposed to models.
Key points
- The model outputs a structured call; the application executes it
- Functions are described with names and parameter schemas
- The basic mechanism behind agents and tool-using assistants
- Arguments must be validated and sensitive actions confirmed
Where AiVibe comes in
AiVibe delivers AI and machine learning services, chatbots and virtual assistants with RAG, MCP tools and voice, AI quality management including bias detection and model validation, and the AIMURUGA AI agent, and builds Intel-based edge AI devices using the Intel Distribution of OpenVINO toolkit.
Related terms
- AI AgentAI & Machine Learning
- Model Context Protocol (MCP)AI & Machine Learning
- Large Language Model (LLM)AI & Machine Learning
- Prompt InjectionAI & Machine Learning
- AI GuardrailsAI & Machine Learning