Tool calling

Also called: function calling

What is Tool calling?

Tool calling is the mechanism by which a language model requests that a specific function be run, returning a structured call rather than prose. The application decides whether the call is permitted, validates its arguments, executes it, and returns the result. This is what separates an agent from a chatbot.

In more detail

Developers describe each tool to the model with a name, a purpose and the inputs it takes. When the model decides a tool would help, it returns a structured request, for example create_lead with a name and an email address, instead of a sentence.

The model never runs anything itself. The application reads the request, checks that the tool exists and is allowed here, validates the inputs, runs it, and passes the result back so the model can carry on the conversation.

That separation is the security model. Anything the application would not let a visitor do directly should not be reachable through a tool, because text in the conversation can influence which tools the model asks for.

Illustration for "Tool calling"GLOSSARYTool calling
Tool calling, defined in plain English.
Tool calling connected to customers and the tools that serve themTool callingAI agentPrompt injectionHandover
Related terms in this glossary.

How SpideyChat handles it

SpideyChat assistants have five possible tools: search the knowledge base, capture a lead, open a support ticket, hand over to a person and notify an external system by webhook. Each is off until the owner enables it, and the server re-checks that before running any call. Arguments are validated and undeclared fields dropped, and one reply can involve at most three rounds of tool calls.

We make SpideyChat. The rest of this page describes the term in general, not our product.

Questions

Is function calling the same as tool calling?
Yes. Function calling was the earlier name; tool calling is now the more common one.
Can a chatbot with tools do anything it is asked?
No. It can only request the tools it has been given, and the application decides whether each request runs.

All glossary terms