# Tool calling

> Tool calling, also known as function calling, is the mechanism that lets a language model request that an external function be run. The model is shown a list of tools with descriptions and input schemas. When one is needed, it outputs a structured request naming the tool and its arguments, the application executes it, and the result is returned to the model.

Source: https://similariq.ai/glossary/tool-calling · Updated 2026-11-25

## What tool calling is

Tool calling is how a language model reaches beyond its own text. A model by itself can only generate words from what it learned in training and what sits in the current conversation. It cannot look up a live price, read a private database or send a message. Tool calling gives it a controlled way to ask for those things. The model writes a request in a fixed format, and the software around it carries the request out.

The terms tool calling, function calling and tool use describe the same idea. The important detail is the division of labour. The model decides that a tool is needed and what arguments to pass. The application, sometimes called the harness or the client, performs the actual call and hands back the result. The model does not run code or touch a network. It only proposes, and the application disposes.

## Why it matters

Without tools, a model's knowledge is frozen and its answers are unverifiable guesses about anything that changes. With tools, it can fetch current facts, perform exact arithmetic, query systems of record and take actions. That shift turns a text generator into something that can complete tasks. Tool calling is the foundation that every [AI agent](https://similariq.ai/glossary/ai-agent) is built on: an agent is, at its core, a model calling tools in a loop.

It also matters for reliability. When a model needs a number, having it call a function that returns the number is far safer than having it recall or estimate one. Tool results give the model grounded material to reason from, and they give you a record of where each fact came from. A well-designed tool is often the most effective fix for a model that keeps getting a particular kind of question wrong.

## How a tool call works, step by step

Each tool is defined by three things: a name, a natural-language description of what it does and when to use it, and a schema that specifies its inputs. The schema is typically written in JSON Schema, listing each parameter, its type and whether it is required. The application sends these definitions to the model along with the user's request.

The model reads the request and the definitions and makes a choice. If no tool helps, it answers directly. If one does, it emits a tool call: the tool's name plus a set of arguments that conform to the schema. The application validates the arguments, runs the function and returns the output as a tool result. The model then continues, either answering or requesting another call. Several calls may be requested at once if they do not depend on each other.

- Define: name, description and input schema for each tool.
- Offer: send the definitions to the model with the conversation.
- Request: the model returns a tool name and arguments.
- Execute: the application validates and runs the function.
- Return: the result goes back to the model as a tool result.
- Continue: the model answers or asks for another call.

## A hypothetical example

Suppose an application defines a tool named `get_order_status` with one required string parameter, `order_id`, and the description: look up the current shipping status of a customer order. A user writes that order A-1047 has not arrived and asks where it is. The model recognises that the question matches the tool and returns a call to `get_order_status` with `order_id` set to A-1047.

The application runs the lookup against its order system and returns a small JSON object saying the parcel left the warehouse two days ago and is due tomorrow. The model reads that result and writes a plain reply to the user. If the user had asked about the returns policy instead, the model would have answered without calling anything, because the description gave it no reason to think the tool applied.

## Tool calling, MCP and structured output

Tool calling is a capability of the model and the application around it. It says nothing about where tool definitions come from. A developer can hard-code them, or they can arrive from a server that follows the [Model Context Protocol](https://similariq.ai/glossary/model-context-protocol), which standardises how services publish tools so any compatible application can discover them. A [remote MCP server](https://similariq.ai/glossary/remote-mcp-server) is such a service hosted on the network. MCP supplies the catalogue; tool calling is how the model orders from it.

[Structured output](https://similariq.ai/glossary/structured-output) is a close relative. Both ask a model to emit data matching a schema. In tool calling, the structured data is the arguments to a function that will be executed. In structured output, the structured data is the final answer itself. Some systems use the same underlying machinery for both, and a tool result is commonly structured data too, which keeps the next step predictable.

## Common mistakes

Most tool-calling problems trace back to descriptions. The model chooses a tool by reading its description, so a vague or misleading one produces wrong choices. State what the tool does, when to use it, when not to, and what it returns. Parameter names and descriptions deserve the same care. A field called `q` invites guesses; a field called `company_domain` with an example value does not.

Other mistakes are structural. Offering dozens of overlapping tools makes selection harder. Returning huge or unstructured results fills the context and buries the useful part. Skipping validation lets malformed arguments reach your systems. Failing to return clear error messages leaves the model unable to correct itself. And executing every requested call without checks is dangerous for tools that spend money, delete data or contact people. Those deserve limits or human approval.

## How to evaluate tool calling

Test three things separately. Selection: given a request, does the model pick the right tool, and does it refrain from calling one when none is needed? Arguments: are the values correct and valid against the schema? Use of results: does the final answer reflect what the tool returned, without inventing details? A failure in each category has a different remedy, so recording which one occurred saves time.

Build a small set of test requests that cover ordinary cases, ambiguous cases and cases where no tool applies. Run them repeatedly, since model behaviour varies between runs. Track the number of calls per task and the error rate from the tools themselves. When a failure appears, read the transcript before changing anything. Rewording a description or adding one example is frequently enough to fix it.

## How it shows up in SimilarIQ

SimilarIQ publishes its functions as tools through a hosted [MCP server](https://similariq.ai/features/mcp-server) with 10 tools. The main one, `find_similar_companies`, takes a company domain and returns up to 100 ranked look-alike companies. Each result carries `rank`, `company`, `domain`, `matchScore`, `type`, `confidence` and `likelyCompetitor`. That call costs 1 credit, which is $0.25. `start_bulk_search` costs 1 credit per domain, and the remaining eight tools, such as `get_bulk_job`, `list_recent_searches` and `get_search_balance`, are free.

If you would sooner define the tool yourself, the REST API does the same job: one `POST` to `/api/v1/search` with a domain, wrapped in your own function definition. The guide on [API versus MCP server](https://similariq.ai/guides/api-vs-mcp-server) compares the two routes. Either way the search takes roughly 30 to 60 seconds, so set timeouts accordingly. This page describes the public interface only. See [sales agent workflows](https://similariq.ai/use-cases/sales-agent-workflows) for examples of tools used in sequence.

## Related terms

Tool calling connects to most of the technical entries in this glossary. An AI agent is the loop built on top of it. The Model Context Protocol and remote MCP servers are how tools are distributed. Structured output governs the shape of what comes back. An API key authorises the calls a tool makes on your behalf, and rate limiting constrains how fast they can be made.

A few adjacent phrases are worth recognising. A tool schema is the formal description of a tool's inputs. Parallel tool calls are several requests issued in one model turn. Tool choice is a setting some applications expose to force, forbid or leave open the use of tools on a given turn.

## Frequently asked questions

### What is tool calling in an LLM?

It is the ability of a language model to request that an external function be run. The model outputs the name of a tool and arguments that match the tool's schema. The surrounding application executes the function and returns the result so the model can use it.

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

Yes. The two terms, along with tool use, refer to the same mechanism. Different platforms prefer different names, but in each case the model emits a structured request and the application carries it out.

### Does the model actually run the tool?

No. The model only produces a request. The application decides whether to execute it, runs the code and passes the output back. This separation is what allows developers to validate arguments, enforce permissions and require approval for sensitive actions.

### How does a model decide which tool to call?

It reads the name, description and input schema of each available tool and compares them with the user's request. Clear descriptions that say when a tool should and should not be used have a large effect on how reliably the right one is chosen.

### What is the difference between tool calling and MCP?

Tool calling is the model-side mechanism for requesting a function. The Model Context Protocol is a standard for how services publish tools so that applications can discover and call them. MCP provides the tools; tool calling is how the model asks to use them.

### Which SimilarIQ tools cost credits when an agent calls them?

Two of the 10 MCP tools cost credits. `find_similar_companies` costs 1 credit per search and `start_bulk_search` costs 1 credit per domain, at $0.25 per credit. The other eight, including reading past results and checking the balance, are free.
