productinterview.tools
MenuClose

AI Tools and Agents: Tool Calling, the Agent Loop and MCP

Tool calling, the agent loop, MCP and memory.

Core3 lessons5 questions

What this module covers

  • Tool calling: how a model asks for an action, and who actually runs it
  • The agent loop, and the controls that keep it safe and bounded
  • MCP, the standard way to connect assistants to tools and data
  • How agents "remember" across steps and sessions

Why it matters, by role

  • Applied AI PMProduct Manager. Decides what a product should do, for whom, and why. Read the full explanation: agents are where most AI products are heading; you'll be asked what they can safely do.
  • AI Platform PM: tool calling, MCP and agent frameworks are platform features.
  • Forward Deployed EngineerForward Deployed Engineer. An engineer embedded with customers who scopes, builds and ships AI solutions into production. Read the full explanation: most customer builds are agents wired into the customer's systems.
  • AI Product Engineer: you'll build the tools and the loop.

Lessons

  1. How tool calling works
  2. The agent loop
  3. MCP and memory

How tool calling works

A model can't do anything by itself; it only produces text. Tool calling lets it ask your code to act:

  1. You describe the available tools to the model: name, purpose and the parameters each takes.
  2. The model decides a tool would help and outputs a structured request: "call get_order with order_id = 1234".
  3. Your code runs the tool, with your permissions and checks.
  4. The result goes back into the model's context, and it continues.

The key point interviewers check: the model never executes anything. Your application does. That's where you enforce permissions, validate arguments and log every action.

Good tool descriptions matter as much as good prompts: a vague description leads to the wrong tool or wrong arguments.

The agent loop

An agent is a model calling tools in a loop until a task is done:

decide → call a tool → read the result → decide again → … → finish

What makes it an agent rather than a fixed workflow is that the model chooses the next step. That flexibility is useful for open-ended tasks and risky for everything else, so agents need controls:

  • A step limit and a budget, so a confused agent can't loop forever.
  • Permission tiers: read-only tools freely; actions with consequences (refunds, emails, deletions) behind limits or human approval.
  • Clear stopping conditions: what "done" means, and when to hand off to a person.
  • Logs of every step, for debugging and evals.

If the steps are always the same, use a fixed workflow instead; it's cheaper, faster and easier to test.

MCP and memory

MCP (Model Context Protocol) is an open standard for connecting AI assistants to tools and data. A service exposes its capabilities once as an MCP server: tools it can run, data it can provide, prompt templates. Any MCP-compatible assistant can then use them, without a custom integration for each app.

Memory is how an agent keeps track of things beyond one request:

Kind How it works Good for
In context Keep the conversation and results in the prompt Within one task
Summaries Compress older steps into a summary Long tasks that would overflow the context window
External store Save facts to a database and retrieve them later Across sessions: preferences, past decisions

Memory brings product questions with it: what's stored, for how long, whether users can see and delete it.

Questions

Foundations

QuestionTypeRolesAsked atSource
Explain how an AI assistant 'books a meeting'. What actually happens, step by step?explainApplied AI PM, AI Platform PM, Forward Deployed Engineer–Representative

Advanced

QuestionTypeRolesAsked atSource
Design how a personal assistant agent should remember things about a user across weeks.designApplied AI PM, AI Product Engineer, AI Safety PM–Representative

Rubric

Dimension Weak Passable Strong
Tool calling "The model calls the API" Structured request, app runs it Who executes, where permissions and validation sit
Loop "It figures it out" Describes the loop Loop plus step limits, permission tiers, stopping and hand-off
Agent vs workflow Agents for everything Knows the difference Chooses a workflow when steps are fixed, and says why
Platform Unaware of MCP Knows what MCP is Explains why a standard protocol matters for builders and users

Next modules