Skip to content
Tool Calling (Function Calling)
core ai

Tool Calling (Function Calling)

Tool calling (function calling) is how a language model outputs a structured request to run a defined function, such as check_order(id) or book_slot(date), instead of plain text. The application executes it and returns the result; this is how an AI agent takes real actions.

Without tools, a language model can only talk. With tools, the developer describes a set of functions to the model (name, purpose, parameters), and when a customer's request matches one, the model replies with a structured call rather than a sentence: {"name": "get_order_status", "arguments": {"order_id": "S-48213"}}. The application runs the real code against Salla, a clinic system or a CRM, feeds the result back, and the model writes the customer-facing answer. The model never touches the database directly; it asks, and the code decides.

This is the line between a chatbot and an agent. A chatbot answers 'How do I reschedule?' with instructions. An agent with a reschedule tool checks the calendar, offers two free slots on Tuesday, moves the appointment, and sends the WhatsApp confirmation. For a Gulf business the useful tools are concrete: order lookup and address change for Salla and Zid merchants, slot search and booking for clinics, payment link creation through Paymob or PayTabs, lead creation in HubSpot or Zoho, and a handoff tool that transfers to staff.

Design decisions that matter: each tool should do one thing and validate its inputs, so a model cannot pass a malformed date or someone else's order number. Irreversible actions (cancel, refund, prescribe) should require confirmation or a human. Every call should be logged with the conversation for audit. Standards such as the Model Context Protocol (MCP) are emerging to describe tools in a reusable way across vendors. Nano AI builds tools as tested integrations, not prompt text, which is why every implementation includes monitoring and evals on the tool paths, not just on the wording of answers.

Chat on WhatsApp