What is Function Calling?#

Function calling connects large language models to external data and real-world tools. Instead of fabricating answers, the model outputs structured arguments (such as JSON) to invoke defined APIs, query databases, or trigger remote actions securely.

Everyday Analogy#

A doctor writing a prescription for a lab test: the doctor doesn't run the centrifuge themselves, but specifies exact test parameters so the lab technician can execute it and return verified results.

Practical Applications#

  • Real-time price and inventory checking in eCommerce bots
  • Automated customer support updating tickets and CRM records
  • AI agents controlling headless browsers, shells, and database systems