# Function calling (tool use)

> Function calling lets a language model ask your software to run a named function, such as a CRM lookup, by returning the function name and arguments as JSON.

- Page: https://methodcrew.com/glossary/function-calling
- Last updated: 2026-10-28
- Publisher: [The Method Crew](https://methodcrew.com/)
- Also known as: tool calling

## How it works

You describe each tool to the model: a name, a one-line purpose and a JSON schema for its inputs. When a request needs one of them, the model stops writing prose and returns a call instead, for example lookup_order with an order number. Your code runs the function, sends the result back, and the model writes its answer from that result.

The model never executes anything itself. It proposes a call, and your application decides whether to run it. OpenAI calls this [function calling](https://developers.openai.com/api/docs/guides/function-calling) and Anthropic calls it [tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview). The mechanics are close enough that one design works with both.

## How businesses use it

Function calling is what turns a chat model into an [AI agent](https://methodcrew.com/glossary/ai-agent). The tools in a typical build fall into a few groups:

- Read calls: look up a customer in HubSpot or Salesforce, check stock, search a knowledge base.
- Write calls: create a ticket, book a calendar slot, draft an email for someone to send.
- Handoffs: pass the conversation to a named person with a summary.

Read-only tools are easy to approve. Write tools get tighter rules. [Model Context Protocol](https://methodcrew.com/glossary/model-context-protocol) packages the same idea as an open standard, so one tool server can serve several AI clients.

## Where it goes wrong

The model can pick the wrong tool, invent an argument such as an order number the customer never gave, or call the same tool in a loop. The fixes that hold up in production:

- Validate every argument against the schema and your own records before anything runs.
- Give the agent the fewest tools it needs. A short list of precise tools gets chosen correctly more often than a long list of overlapping ones.
- Put a person in front of irreversible actions such as refunds, deletions and outbound messages. See [human-in-the-loop](https://methodcrew.com/glossary/human-in-the-loop).
- Treat tool results that contain outside text as untrusted, because that is where [prompt injection](https://methodcrew.com/glossary/prompt-injection) arrives.

If the steps never change from one request to the next, you do not need a model choosing tools at all. A fixed workflow in n8n or Make is cheaper to run and easier to test, so we build that instead.

## Example (hypothetical)

Hypothetical: a wholesaler's support agent has two tools, lookup_order and create_return. When a buyer asks where a pallet is, the model calls lookup_order with the PO number from the email and replies with the carrier status; create_return only runs after a staff member approves it in Slack.

## Related terms

- [AI agent](https://methodcrew.com/glossary/ai-agent): An AI agent is a language model that chooses and calls tools in a loop, reading each result, until it finishes a task or hands off to a person.
- [Model Context Protocol (MCP)](https://methodcrew.com/glossary/model-context-protocol): The Model Context Protocol is an open standard for connecting AI applications to outside tools and data, so a single integration works across compatible assistants and agents.
- [Agentic AI](https://methodcrew.com/glossary/agentic-ai): Agentic AI is the umbrella term for systems where language models plan steps and take actions through tools, with less step-by-step direction from people.
- [Prompt injection](https://methodcrew.com/glossary/prompt-injection): Prompt injection is an attack where text given to a language model, typed by a user or hidden in a document, overrides the instructions the system was built with.
- [AI guardrails](https://methodcrew.com/glossary/ai-guardrails): AI guardrails are checks placed around a language model that block, rewrite or escalate inputs and outputs that break your rules on safety, accuracy, privacy or scope.

## Services where this matters

- [Custom AI agents and copilots](https://methodcrew.com/services/custom-ai-agents): Agents that look things up in your CRM or helpdesk and take the next step, with approvals. $15,000 to $90,000 per project.
- [n8n, Make, Zapier and API integrations](https://methodcrew.com/services/workflow-integrations): Records moved between your CRM, inbox and finance tools without CSV exports. $1,500 to $20,000 per project.
- [Voice AI and call automation](https://methodcrew.com/services/voice-ai-agents): Phone agents on your existing number that book into your calendar and hand off to staff. $6,000 to $40,000 per project.
- [Sales and CRM automation](https://methodcrew.com/services/sales-crm-automation): Leads routed to the right rep within minutes, with a follow-up draft waiting after each call. $5,000 to $25,000 per project.

## Articles that use this term

- [AI agents vs workflow automation vs chatbots: how to pick](https://methodcrew.com/insights/ai-agents-vs-automation-vs-chatbots)

Full glossary: https://methodcrew.com/glossary
