function-calling
Installation
SKILL.md
Function Calling
Overview
Function calling (also called tool use) lets LLMs invoke external functions to take actions or retrieve information. The model decides when and which tools to call; your code executes them and returns results. This enables true agentic workflows where the model can query databases, call APIs, perform calculations, and more.
Core Concept
The flow is always:
- Define tools with schemas
- Send messages + tool definitions to the model
- Model returns a tool call (name + arguments)
- Your code executes the function
- Return the result to the model
- Model uses the result to continue reasoning
- Repeat until the model returns a final text response