info Open to new work opportunities! Contact me
Daniel Hladik AI Automation Engineer

← All terms

Function Calling (Tool Use)

The ability of an LLM to call external functions and tools - the foundation of AI agents and chatbots that take real actions.

What is function calling?

Function calling (sometimes called tool use) is a capability of modern LLMs in which the model does not stop at a text reply but instead generates a structured request to invoke a specific function - for example, "look up shipment 12345" or "create a calendar event." The application executes the function and returns the result to the model, which then produces the final answer for the user.

How function calling works

  1. Via a prompt or the model's API you pass function definitions (name, description, parameters as a JSON schema).
  2. In its response the model decides whether it needs a function - if so, it returns a structured output with the function name and arguments.
  3. Your application calls the function (e.g., an HTTP request to an internal API) and sends the result back to the model.
  4. The model incorporates the result and produces a final natural-language answer.

What function calling is useful for

  • The foundation of AI agents - the model itself decides which tools to call
  • Connecting a chatbot to a CRM, billing system, or database
  • Alternative to MCP - MCP standardizes function calling across models
  • Reliable extraction of structured data and form fields from free text