ModelRefs / Basic Function Calling — Tool Pattern
Basic Function Calling — Tool Pattern
Declare typed functions, let the model choose one, validate arguments, execute, and return results.
Overview
The canonical single-tool invocation loop: expose a JSON-schema-typed function, let the model emit a tool_call, validate the arguments, run the function, and feed the result back as a tool message.
When to use it: You need the model to call exactly one well-defined function reliably.
Pattern details
| Pattern class | function-calling |
|---|---|
| Difficulty | beginner |
| Invocation mode | synchronous |
| Also known as | openai function calling, tool use basic |
| Last reviewed | 2026-06-07 |
Known failure modes
- Invalid arguments — Model emits arguments that fail schema validation. Mitigation: Reject with structured error and let the model retry.
- Hallucinated tool — Model invents a function name not in the registry. Mitigation: Return strict 'unknown tool' error; never execute unknown names.
When not to use it
- Auto-executing free-form strings as code under the guise of a tool.
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Basic Function Calling — Tool Pattern.
Frequently asked questions
When should I use the Basic Function Calling tool pattern?
You need the model to call exactly one well-defined function reliably.
What are common failure modes of Basic Function Calling?
Invalid arguments • Hallucinated tool
Is Basic Function Calling production-ready?
Yes when paired with the safety controls and observability hooks documented on the pattern page.