---
title: "What is tool calling (function calling) in AI? - actionlake"
description: "Tool calling, or function calling, lets a language model request a named function with structured arguments that your app runs. How the loop works and fails."
canonical: https://actionlake.com/glossary/tool-calling
updated: 2026-10-22
---

AI agents

# Tool calling (function calling)

Tool calling, also called function calling, is a language model's ability to answer with a structured request to run a named function with arguments, which the application executes before handing the result back to the model.

Updated 22 October 2026 Also called Function calling, Tool use 3 sources checked

**On this page**

Connect an agent to every system you run.

100,000 calls free a month. No card.

[Start free](https://actionlake.com/console?start=sandbox)

## What it is

A model on its own can only produce text. With tool calling, the application tells the model which functions exist, each with a name, a description and a JSON Schema for its arguments. When the model decides a function would help, it returns a structured call instead of prose. The application runs the function and sends the result back. OpenAI's documentation calls it function calling; Anthropic's calls it tool use. The idea is the same.

## Why it matters

Tool calling is what turns a chat model into an [AI agent](https://actionlake.com/glossary/ai-agent). It lets the model read live data and take actions: look up an order, create a ticket, send an invoice. It also moves risk. Once a model can call a function that writes, a wrong guess becomes a wrong action in a real system.

## How it works

OpenAI's guide describes the loop in five steps:

1. Send the model a request with the tools it may call.
2. Receive a tool call from the model.
3. Run the code in your application with the arguments it chose.
4. Send a second request with the tool's output.
5. Receive the final answer, or more tool calls.

In Anthropic's API the model signals this with `stop_reason: "tool_use"` and a `tool_use` block; the application replies with a `tool_result`. Tools the provider runs itself, such as web search, are called server tools; tools your code runs are client tools. The [Model Context Protocol](https://actionlake.com/glossary/mcp) standardises how the application finds those functions on other systems.

## Example

Asked "what's the weather in Wellington?", the model returns a call to `get_weather` with `{"location": "Wellington"}`. The application calls a weather service and returns "14 degrees, windy". The model answers in a sentence.

## Common pitfalls

- **Invented arguments.** Anthropic's documentation notes that when a required parameter is missing, a model may infer a plausible value rather than ask. Validate on the server.
- **Duplicate writes.** A retried call after a timeout can run twice. Use an [idempotency key](https://actionlake.com/glossary/idempotency-key).
- **Too many tools.** Selection accuracy falls as the list grows. See [tool overload](https://actionlake.com/glossary/tool-overload).
- **Policy in the prompt.** "Never delete anything" in a system prompt is advice, not a control. See [agent permissions](https://actionlake.com/glossary/ai-agent-permissions).

## How actionlake handles it

With actionlake, the server governs step 3, the execution. When an agent calls `do`, the server validates the arguments against the action's schema, checks the key's scope, reserves against its [spending cap](https://actionlake.com/glossary/agent-spending-cap), holds the call for [approval](https://actionlake.com/glossary/human-in-the-loop-approval) if a rule says so, deduplicates the write, sends it, and records the outcome in the [ledger](https://actionlake.com/glossary/agent-audit-log) with the agent's stated intent. Before any of that, `check` runs the same validation as a free [dry run](https://actionlake.com/glossary/dry-run). The [platform page](https://actionlake.com/platform) shows the full path.

## Questions

**Is function calling the same as tool calling?**

Yes. OpenAI's documentation uses function calling and Anthropic's uses tool use; both describe a model returning a structured request to run a named function with arguments.

**Does the model run the function itself?**

No. The model only proposes the call. Your application, or the provider for server tools, runs it and returns the result.

**How is tool calling related to MCP?**

Tool calling is the model's ability. MCP is a protocol for discovering and invoking tools on other systems, so the same tool definitions work across different AI applications.

## Related terms

- [MCP tool An MCP tool is a named function that an MCP server offers to AI models, described by a name, a plain-language description and a JSON Schema for its input, and invoked with a tools/call request.](https://actionlake.com/glossary/mcp-tool)
- [AI agent An AI agent is software in which a language model decides its own next steps and tool calls in a loop, using results from its environment, until a goal is met or a stopping condition is reached.](https://actionlake.com/glossary/ai-agent)
- [MCP The Model Context Protocol (MCP) is an open standard that lets an AI application connect to external systems and discover and call their tools, read their resources and use their prompts through one JSON-RPC message format.](https://actionlake.com/glossary/mcp)
- [Dry run A dry run checks whether an agent's action would succeed, whether it is allowed and what it would cost, by validating the inputs, permissions and connection without sending anything to the vendor.](https://actionlake.com/glossary/dry-run)
- [Idempotency key An idempotency key is a unique value attached to a write request so that if the same request is delivered twice, after a timeout or a retry, the server performs it once and returns the stored result for the repeat.](https://actionlake.com/glossary/idempotency-key)

## Sources

1. [Function calling](https://developers.openai.com/api/docs/guides/function-calling) OpenAI · checked 22 October 2026
2. [Tool use with Claude](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) Anthropic · checked 22 October 2026
3. [Server features: Tools (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25/server/tools) Model Context Protocol · checked 22 October 2026

[All 30 glossary terms](https://actionlake.com/glossary)

## Connect an agent. Start free.

[Start free](https://actionlake.com/console?start=sandbox) [Read the quickstart](https://actionlake.com/docs/quickstart)

100,000 calls free every month. No card. Hard caps on every key.

---

Source: https://actionlake.com/glossary/tool-calling
More: https://actionlake.com/llms.txt
