Function calling (tool use) allows LLMs to request calls to external functions/APIs by generating structured invocations. The model selects which tool to use and with what arguments — the application executes the function and returns results. This transforms LLMs from text generators into capable agents. Key capabilities: multi-step reasoning with real data, parallel function execution, structured data extraction (no regex), and workflow automation. Supported by all major providers (OpenAI, Anthropic, Google).
GPT-4o executing multiple tool calls simultaneously.
The model reads the description to decide when and how to use a tool. 'Query the database' is poor. 'Search the products table by name, category, or price range. Returns product_id, name, price, stock_count.' enables much better decisions.
When the model needs data from multiple sources, it can request all calls simultaneously — eliminating serial round-trip latency. Comparing 3 stock prices sequentially: 3 × 500ms = 1.5s. In parallel: 500ms total.
Instead of prompting 'Return a JSON object with fields x, y, z' (fragile), define a tool schema and force tool_choice='required'. The model guarantees valid JSON matching your schema — production-grade extraction.
Sign in to share your feedback and join the discussion.