AI APIs106 · Module III · Lesson 12 of 14
Article · 12 min

Function calling across providers

The shapes, compared.

Summary

Function calling (tool use) is supported by every major provider with subtly different shapes. OpenAI, Anthropic, Google, xAI, and many open models all support it. Parallel tool calls, forced tool use, and streaming tool arguments vary by provider.

Objectives
  • 01State the common shape (name, description, JSON Schema parameters).
  • 02Name the three provider-specific quirks that trip integrations.
  • 03Design a portable tool interface.
The Lesson

The common shape

Every provider takes a list of tool definitions with name, description, and a JSON Schema for parameters. Model output is either text or a tool call with name + arguments. Your code executes and appends the result to the conversation.

The quirks

Parallel tool calls: OpenAI yes, Claude yes, Gemini yes, some open models no. Forced tool use: OpenAI ('tool_choice'), Anthropic ('tool_choice'), Google (different mechanism). Argument streaming: OpenAI supports token-level streaming of tool args; not all providers do.

Key Ideas
  • Function calling is universal in shape, subtly different in mechanics.
  • Design tools to the least common denominator if you want portability.