LLM Function Calling
LLM function calling lets a model request an application-defined operation by producing a tool name and arguments. The application validates and executes the request, returns a result and continues the interaction, connecting model interpretation to controlled access to data or actions outside the model itself.
What it is
The application supplies tool descriptions and argument schemas. During generation, the model can emit a request instead of or alongside a user-facing answer. The runtime then decides whether to execute it and returns the operation's result for subsequent generation. Structured arguments make the interface inspectable, but the model does not execute the business operation merely by naming it. This differs from free-text instructions interpreted by ad hoc parsing and from MCP, which standardizes a wider client-server integration. A function-call schema constrains representation; authorization and the meaning of the requested action remain application responsibilities.
What the work involves
The practitioner defines tools with narrow, predictable responsibilities and schemas that exclude invalid combinations. Context already known by the application should not need to be regenerated as arguments. Input validation, permission checks and idempotency belong before external effects. Useful outputs include tested tool contracts and traces linking requests to results. Evaluation covers wrong tool selection, missing arguments and failed tools, including whether the model reports an unsuccessful action accurately instead of claiming completion from the existence of a call.
Illustrative example
A delivery assistant has a tool to look up shipment status and another to request an address change. A status question triggers only the read operation. An address-change request produces structured arguments, but the application checks identity and whether the shipment remains editable before execution. A rejected change returns a clear error. The final response is tested against that result, ensuring the assistant does not tell the user that the address was updated when the service refused it.
Limits and common mistakes
Schema-conforming arguments can still refer to the wrong record or contain an incorrect interpretation. Parallel calls may conflict, and retries can duplicate effects without idempotent handling. Ambiguous tool descriptions increase selection errors. Quality requires correct operation choice, valid authorized arguments and truthful reporting of results. Function calling is a control interface, not a guarantee that the model understands business rules; operations should enforce those rules even when the generated request appears confident.
Prerequisites
Function calling IS structured output with tool schemas — the model must produce valid JSON matching a function signature
- mediumAPI Development
Tools exposed via function calling are often API endpoints — understanding API design helps design better tool interfaces
Related skills
- → is part of: AI Agent Design
- → is part of: Agentic RAG
- ← is part of: Structured LLM Outputs
- → is subcategory of: Large Language Models (LLM)
Sources and further reading
- OpenAI function calling guide
Explains the tool request-execution-result cycle, argument schemas and application-defined function contracts.
Last updated: 2026-10-10