What is function calling — CCA-F Exam Prep

PencilPrepPencilPrep
L1.22|What is function calling
1/12
Real story
A person sitting at a desk, talking to their laptop. On screen: a chat interface with Claude. The user's message: 'What's the weather in Calgary?' Claude's response: 'I don't have access to real-time weather data.' The person looks frustrated. Home office, afternoon light.

You ask Claude: "What's the weather in Calgary?"

Claude says: "I don't have access to real-time weather data. As of my last training update..." and gives you stale information from months ago.

But you're a developer. You gave Claude a get_weather tool. Now you ask the same question.

Claude responds: "I need to call get_weather with location='Calgary'." Your code runs the function. Gets back: 72F, sunny. Sends the result to Claude. Claude says: "It's 72 and sunny in Calgary right now."

Same question. Same model. Completely different answer. That's function calling.