# What is tool calling?

> First published 2026-11-30
> Source: https://viktor.com/learn/tool-calling

Tool calling is how an AI model, the software that writes a response, asks other software to fetch data or take an action. The model chooses a tool and supplies the details. Software runs the request and returns a result, which the model uses to answer or continue working. For a business, that can mean checking whether an invoice was paid before drafting a reminder.

## How does a request become an action?

An invoice lookup needs access to the accounting system. A model's written answer alone can't show whether a customer has paid. A tool gives the model a way to request that data from software with access.

The tool needs a description. A lookup tool could accept an invoice number and return its payment status. A separate tool could send an email. The descriptions tell the model what each tool does and when to use it, including which details to supply.

The [request and result loop](https://developers.openai.com/api/docs/guides/function-calling) works like this:

1. The software gives the model the request and the available tool definitions. Each definition includes a name, a description and rules for the inputs. Those rules form a schema: a set of rules for which fields are allowed and what each field can contain.
2. The model chooses a tool and fills in its inputs, also called arguments. For the lookup, the input could be the invoice number. The model produces a structured request naming the tool. Saying it will check isn't enough.
3. Software receives the request, checks the inputs and the caller's access, then runs the allowed action. The permission checks belong in that software. A model's choice of tool doesn't grant permission to use it.
4. The tool returns a result, such as the invoice's payment status, or reports a failure. The software passes the result back to the model and matches it to the request it answers.
5. The model uses the result to answer the person or request another tool. A payment lookup could lead to a reminder draft, followed by a separate request to send. Any required approval belongs before the send runs.

The schema makes the input precise. For example, it can require an invoice number and reject an extra field. Strict schema checking can [enforce the expected format](https://developers.openai.com/api/docs/guides/function-calling). It can't prove that the number belongs to the invoice the person meant.

Nor does every turn need a tool. The model can answer directly when the chat already contains what it needs. A response can also request several tools, if the system supports that. Lookups that don't depend on each other can run together, but a reminder based on payment status needs the lookup result first.

When watching a demo, ask to see the returned result as well as the request. A statement that the model plans to check an invoice isn't evidence that the lookup happened.

## What can go wrong between choosing and doing?

An invoice number can fit the schema perfectly and still point to the wrong customer. If a request lacks a required detail, a model can guess instead of asking. Clear tool descriptions help explain the inputs, but a valid format alone doesn't make an action correct.

A tool can fail, too. The [tool specification](https://modelcontextprotocol.io/specification/2025-06-18/server/tools) distinguishes failures in the request from failures while the tool runs. An unknown tool and a failed lookup are different problems. Neither is a payment status.

A more dangerous failure starts in material the system reads. An email can contain instructions planted to divert the model, a problem called prompt injection. If the system can send email, that bad instruction can become an outgoing message.

The [OWASP security guidance](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/) describes how excessive access lets mistaken or manipulated output cause harm. Its recommendations include limiting tools to the work required and granting only the permissions that work needs. Reading invoices doesn't require permission to delete them.

Require a person to approve high-impact actions, and have the software check permission on every request. A written instruction telling the model to be careful can't replace those checks. Ask which account an action uses and what that account can change before allowing it to run without approval.

## What would an overdue invoice reminder involve?

Consider a made-up example: an agency owner asks an AI system to check an invoice and draft a reminder if it's unpaid. The owner wants a draft, with no message sent.

The model requests the invoice's payment status using the number the owner supplied. The accounting tool returns that the invoice is unpaid. The model can now prepare a reminder from that result and the invoice details, without requesting the send tool.

If the lookup fails, the system has no returned status to support the reminder. It should report the failed check instead of treating the failure as unpaid. If the owner later asks to send, sending is a new action with its own inputs and permission checks.

For a trial, test the failed lookup as well as the successful one. Check that the system leaves the email unsent when the request asks only for a draft.

## How does Viktor handle connected tools?

Viktor works in the apps your team already uses. You connect each app once through that app's own sign-in, and he can use it in chat and scheduled tasks.

Each tool on a connected account has a setting: Off, Run automatically or Ask for confirmation. For a tool set to Ask for confirmation, he asks for approval each time before using it.

He prepares an action needing approval as a draft and posts an approval card. The action runs only after someone clicks Approve. A rejected draft never runs.

People outside a private connection's access list can't use that connection through Viktor, even when they ask him directly. The [integration permissions documentation](/docs/integration-permissions) describes the tool settings and who can use each connection.

See the [apps Viktor connects to](/integrations).

## Common questions

Tool definitions and permissions answer different questions. These follow-ups separate the calling mechanism from where tools run and how applications share them.

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

Function calling supplies inputs to a named function, a piece of code that performs a task, using a defined schema. Tools can also accept free-form text. The exchange stays the same: a request goes out and a result comes back.

### Can the company supplying the model run the tools?

Yes, tools can run on that company's computers, called servers, instead of in the app using the model. In [client and server tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview), the difference is who runs the requested code and returns the result. Hosting alone doesn't grant the tool access to your data.

### How does MCP relate to tool calling?

The Model Context Protocol, or MCP, gives apps a shared way to list tools, describe their inputs and request that they run. Tool calling is the model's use of a tool. MCP sets the format for the messages software sends when listing and using tools.

## Related

- [Connect your tools](/docs/connect-your-tools)
- [How the Model Context Protocol connects AI apps to your tools and data](/blog/what-is-model-context-protocol)
