May 27, 2026

What are AI function calls? Tool use explained

Reading time :  
6
 min
Isha Maggu
Isha Maggu

What are AI function calls? Tool use explained

AI function calls let an LLM do things in the real world — not just generate text, but call APIs, query databases, trigger actions, and interact with external systems. Function calling transformed LLMs from text generators into workflow participants.

How function calling works

Definition: You define available functions (name, parameters, descriptions) when calling the LLM API. OpenAI calls these "tools," Anthropic calls them "tool use," Google calls them "function declarations." Decision: The model receives a user message and tool definitions, then decides whether to call a function based on understanding user intent — not hard-coded rules. Execution: The model returns a structured function call (name + arguments). Your application executes the function, gets the result, and sends it back to the model for a final response.

Why function calling matters for automation

Before function calling, connecting LLMs to external systems required brittle prompt engineering. Function calling provides reliable structure (typed, validated function calls), selective invocation (model chooses whether to call a function based on context), and multi-step reasoning (chain of function calls). CodeWords uses function calling extensively — when Cody builds a workflow that scrapes a website, analyzes with an LLM, and posts to Slack, each step is orchestrated through function calls with native access to OpenAI, Anthropic, and Google Gemini.

Common pitfalls

Over-specifying tools, missing error handling, and ignoring cost (each function call round-trip adds cost). Build AI-powered workflows on CodeWords →

Contents
Ready to try CodeWords?
Get started free
Sign in
Sign in