by Kondasamy Jayaraman

Module 2 · AI

Intermediate RAG recommended · by Kondasamy Jayaraman

How AI assistants go from answering to acting

An assistant that answers from documents can’t check an order or issue a refund. Tool calling lets the model ask your software to do it, and the Model Context Protocol (MCP) is how those tools plug in. You’ll wire it up, watch it misfire, and make it safe.

Read as
OK

The whole idea in one question

Same model. Same question. One can check.

An employee asks “Hollis Hardware is on the phone: where is order 1042?”

Without tools

Guessed
???

“Order 1042 is most likely on its way. Orders usually arrive within three to five business days, so it should reach you soon.”

The model can’t see Larkspur’s order system, so it writes something that sounds likely.

With a tool

Checked
OK

“Order 1042 was delivered on 14 October 2026. It was one Wren WL-4 label printer.”

The model asked forget_order(order_id: 1042)

These are the course’s own recorded model turns, and the order comes from Larkspur’s order data. The only thing that changed is whether the model had a tool.

How it works

Three ideas carry the whole module

Where is order 1042?question + 2 toolsget_order(order_id: 1042)order 1042: deliveredOrder 1042 was delivered on 14 Oc…Order 1042 was delivered on 14 Oc… Order 1042 was delivered on …
Message 6 of 6
  1. 1 Describe the tool

    Name, description, schema

    A tool is defined by a name, a description of when to use it, and a JSON Schema for its arguments.

    Source, checked 20 October 2026

  2. OK

    2 The model asks, your software runs it

    The model only asks

    The model only returns a structured request to call a tool; the application runs it and sends the result back.

    Source, checked 20 October 2026

  3. 3 One plug for many tools

    Tools, resources, prompts

    Servers offer three features: tools (functions for the model to run), resources (context and data) and prompts (templated messages for users).

    Source, checked 20 October 2026

The story

The assistant has to act now

Back at Larkspur Supply Co., the assistant that answers from documents must now act: check an order, issue a refund. Staff want it to look things up and get things done, and an answer from documents can’t do either. You’re on the team that gives it tools, and keeps them safe.

New to Larkspur? The RAG module builds the assistant this one starts from.

5
orders in the order system
4
tools the assistant can call
2
MCP servers to plug in
2026-07-28
MCP specification version

Requests waiting for the assistant

  • “Hollis Hardware is on the phone: where is order 1042?”

    The answer lives in the order system, not in any document

  • “Hollis Hardware wants to know where orders 1042 and 1043 are.”

    Two lookups that don’t depend on each other

  • “Hollis Hardware says order 1042 arrived damaged. Refund it in full.”

    It moves money, so a person should approve it

  • “Marlow Builders asks: has order 1047 arrived?”

    The order holds a note written to trick the model

Your path

The chapters

  1. Chapter 1

    Answers aren’t actions

    Can an assistant that answers from documents tell you where an order is right now?

  2. Chapter 2

    Your first tool

    How does a model know a tool exists, and when to use it?

  3. Chapter 3

    Valid isn’t correct

    What does checking a call against its schema catch, and what slips through?

  4. Chapter 4

    Many tools, many steps

    How does the assistant handle a request that needs several tool calls?

  5. Chapter 5

    MCP: one plug for many tools

    How can any AI app use any system’s tools without a custom integration for each pair?

  6. Chapter 6

    When tools go wrong

    What stops a tool call that should not run?

  7. Chapter 7

    Workbench

    Given a request, which servers, gate and permissions should the host have?

Who it’s for

  • Product managers
  • Engineers
  • Analysts
  • No code needed

Product managers, engineers and analysts whose company is giving its AI assistants access to real systems, who want to know how that works, where it goes wrong, and what keeps it safe. No code needed. If RAG is new to you, play that module first.