Moyan AI Training Institution LogoMoyan AI

Agents · Established · Intermediate

Function Calling

The API mechanism where a model returns a structured call to a declared function instead of free text.

What Function Calling is

Function calling is the concrete protocol behind tool use: you declare functions with JSON schemas, and the model responds with a validated name and argument object.

How it works

The provider constrains decoding so arguments conform to the schema. The application executes the function, appends the result to the conversation, and lets the model continue. Parallel calls and forced tool choice are common options.

Why it matters

It turned assistants into reliable software components by replacing fragile text parsing with typed contracts.

Common uses

  • Backend action execution
  • Structured extraction
  • Agent tool routing
  • Form and workflow filling

Strengths

  • Type-safe integration
  • Eliminates brittle parsing

Watch for

  • Model may still choose the wrong function
  • Schema drift between providers

Continue exploring

More in this collection

Browse all AI Concepts