Function Calling

A way for a model to produce structured arguments for a tool or function instead of free text alone.

Which side actually checked the room?

A fictional booking app exposes a read-only room lookup. A visitor asks whether Cedar Room is available for a group of six.

  1. Requested arguments

    The model supplies room ID cedar and integer party size 6. The application also requires a date and time before it can make a meaningful lookup.

  2. Validation

    The application checks that required fields are present, the room exists and the caller may view availability. A valid integer alone cannot establish any of those facts.

  3. Confirmed result

    After the visitor supplies a time, the calendar returns “available.” That describes a slot at lookup time. A reservation would need its own request and confirmation.

Which evidence belongs in the answer?

A proposed function call records what the model wants to ask. The returned calendar record supports the availability claim. If the call never runs, a well-formed argument object supplies no booking information.

Why Function Calling Helps

Structured output reduces ambiguity. If a model has to provide fields like date, time zone, user ID, or search query in a known schema, the application can validate the inputs before doing anything. That makes workflows more reliable than trying to parse free-form prose after the fact.

Function calling is often used for scheduling, retrieval, customer lookup, calculations, workflow routing, and any task where the model needs to interact with software. It is one of the core techniques behind modern tool use and agent systems.

Follow the idea

Tool Use · Trace the complete request and result.

AI Agent · Place the lookup inside a longer task.

Source · JSON Schema guide to object properties and required fields

Return to Function Calling in the A–Z glossary