LearnThatStack Ace your next interview
AI Agents · question
Question 3 of 54

What is tool use (function calling), and why is it called the foundation of agents?

beginner
← All AI Agents questions
Re-explain

Tool use, also called function calling, lets you hand the model a list of typed function definitions. The model never runs code. It returns a structured request that names one tool and its arguments. Your code runs it and passes the result back.

{ "type": "tool_use", "name": "get_order", "input": { "order_id": "A-1187" } }

It is the foundation because a raw model can only produce text from what it learned in training. Tools give it fresh reads of the world and real writes to it. Almost every other agent capability ships as just another tool: retrieval, memory, even calling another agent.

The tradeoff is that the model decides but your code executes. Tool selection is probabilistic, so validation, permissions and rate limits belong in your handler, never in the prompt.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
Guided practice for AI Agents One question at a time. Answer out loud, get graded, see what you missed.
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens How interviewers actually use this question

Likely follow-ups

What you can say

  1. Tool use, also called function calling, means you give the model a list of typed function definitions, and it can ask to call one instead of only answering in text.
  2. The model never runs code itself. It returns a structured request that names one tool and its arguments, like get_order with an order ID.
  3. My code runs that call and passes the result back, and the model continues from there.
  4. It's the foundation of agents because a raw model only knows what it learned in training. Tools give it fresh reads of the world and real writes to it.
  5. Most other agent capabilities ship as just another tool, like retrieval, memory, or even calling another agent.
  6. The catch is that the model decides but my code executes. Tool selection is probabilistic, so validation, permissions and rate limits go in the handler, never in the prompt.

Weak answers to avoid

  • Says the model executes the function The model only returns a structured request. Your code runs it and sends the result back, and that is where control and safety sit.
  • Relies on the prompt to block bad calls Tool choice is probabilistic and prompts can be ignored or injected. Put validation, permissions and rate limits in the handler code.
  • Defines it but skips why agents depend on it The question asks why it's the foundation. Say that tools give fresh reads and real writes, and that retrieval, memory and subagents all ship as tools.
Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the AI Agents cheatsheet.

← Back to all AI Agents questions
Pro · $10/mo

47 of 54 AI Agents answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime