As asked
Explain how function calling works in LLM APIs at the protocol level: what you send in the request, what the model returns, and how you execute the function and close the loop.
Sample answer outline
Strong answers describe sending a tools array with each tool's name, description, and parameter schema, the model returning a tool_use content block with the chosen name and arguments JSON, the caller executing the function locally and returning a tool_result message, and the model then generating its final text response. Candidates should know the difference between Anthropic's and OpenAI's naming conventions for these fields.
Expect these follow-ups
- What does the model's output look like when it wants to call two tools at once?
- How does the model signal that it has finished using tools and wants to give its final answer?