WEBVTT

00:00.040 --> 00:02.960
Well, I don't know how this day always comes along so fast.

00:02.960 --> 00:07.800
It feels like just the other day we were starting, we were doing instant gratification and then the

00:07.800 --> 00:08.920
foundations.

00:08.920 --> 00:10.120
And now here we are already.

00:10.120 --> 00:11.840
It's the penultimate day.

00:12.040 --> 00:14.280
It is week three, day four.

00:14.320 --> 00:15.800
It's our last Purple day.

00:16.080 --> 00:19.720
As we embark on the topic of context engineering.

00:19.960 --> 00:22.840
Subagents so much juicy stuff.

00:22.840 --> 00:29.560
And then we begin today, the capstone project that we will complete tomorrow as we wrap the whole thing

00:29.560 --> 00:29.960
up.

00:30.480 --> 00:31.280
Let's get going.

00:31.280 --> 00:35.320
I promised you a big day yesterday and it was a fiendishly big day.

00:35.440 --> 00:44.640
We covered MCP, the model context protocol from anthropic, as they call it, the USB-C for AI apps,

00:44.680 --> 00:51.240
and they also call it the open source standard that connects AI applications to external systems.

00:51.240 --> 00:55.360
Or really, for the part that we really care about is tools.

00:55.560 --> 00:59.200
And I started yesterday by by going through what MCP is not.

00:59.280 --> 01:04.780
And after we laid that to rest, we covered the couple of things that MCP really is, and we put both

01:04.780 --> 01:05.780
of them to use.

01:05.980 --> 01:10.980
And of course, one of them and the main one, the one that is most important and the one that you should

01:10.980 --> 01:18.740
definitely remember, is that MCP gives us this simple way to use tools that have been written by somebody

01:18.740 --> 01:19.380
else.

01:19.540 --> 01:24.660
And so if someone has written MCP tools and they've packaged them into this, this MCP way of doing

01:24.660 --> 01:31.140
things, then it's really easy to connect them in to your app or your workflow.

01:31.300 --> 01:37.420
So it turns out that there's some things where Nan did not have a pre-baked tool that we could just

01:37.420 --> 01:44.660
use, Fire Crawl in particular, but Fire Crawl did have an MCP server, and so we could create an MCP

01:44.660 --> 01:50.820
client node that connected directly to it and just exposed its tools to our LLM.

01:51.060 --> 01:52.460
And it worked great.

01:52.620 --> 02:00.100
And we did it for Hunter.io as well, even though Hunter.io does have a tool in in the library, but

02:00.100 --> 02:03.580
it turns out that it was able to use some tools that aren't exposed to Nan.

02:03.620 --> 02:06.530
So we did get some benefit anyway by using MCP.

02:06.730 --> 02:08.170
So it was it was pretty cool.

02:08.210 --> 02:13.370
But the takeaway here is that this is the way that people use MCP, and this is the thing you need to

02:13.410 --> 02:14.370
know about that.

02:14.410 --> 02:19.490
MCP gives you an ability to use someone else's tools in a really easy way.

02:19.610 --> 02:21.090
As we saw for ourselves.

02:21.250 --> 02:26.890
And then the other thing that you can do with MCP is just the flip of this is to say, if you've built

02:26.890 --> 02:31.410
a tool and you like the tool you've built, and it's something that other people could benefit from,

02:31.450 --> 02:37.850
or maybe you could benefit from it in a different app, then MCP gives you this really easy way to equip

02:37.890 --> 02:41.770
another LLM with your tool to share your tool.

02:41.890 --> 02:44.010
And that is also what we did.

02:44.010 --> 02:45.010
We took everything.

02:45.010 --> 02:49.810
We'd built our prospecting subagent, which itself was using MCP.

02:49.890 --> 02:51.970
It didn't need to of course, it could have been anything.

02:51.970 --> 02:58.170
But we happened to pick that that prospecting agent and we packaged all of that up into an MCP server.

02:58.210 --> 03:04.850
We added an MCP server trigger node, and then we just said, okay, this is MCP server.

03:04.850 --> 03:12.150
And that means that anyone that has that URL can use This can can equip their Lem to use this tool as

03:12.150 --> 03:14.630
part of their workflow and to try it out.

03:14.670 --> 03:18.470
We picked something I picked clawed the the application.

03:18.470 --> 03:20.750
It's anthropic's version of ChatGPT.

03:20.990 --> 03:28.590
We use that, we connected it to our prospecting MCP server, and suddenly Claude was able to hunt for

03:28.590 --> 03:33.030
leads for us using behind the scenes using Fire Crawl and Hunter.io.

03:33.230 --> 03:38.430
Not that it knew that, but all of that was happening and I thought that was just a great end to end

03:38.470 --> 03:39.190
example.

03:39.190 --> 03:47.150
We were sharing tools through MCP, and as it happens, those tools themselves were using MCP servers

03:47.150 --> 03:47.670
too.

03:47.710 --> 03:49.990
They were using Fire Crawl and Hunter.io.

03:49.990 --> 03:56.390
So we were using MCP at two levels, and I thought that was just a just a great end to end example,

03:56.470 --> 03:58.150
and I hope it landed for you too.

03:58.190 --> 04:05.110
And then one more thing to recap on is structured outputs that honestly, I think this is so important.

04:05.150 --> 04:09.030
And they don't get enough air time and they should do structured outputs.

04:09.030 --> 04:15.300
Of course it is this idea that you can say an LLM that normally just generates natural language, you

04:15.300 --> 04:16.500
can constrain it.

04:16.500 --> 04:24.220
So it has to generate JSON and that JSON needs to to fit to a particular structure called the schema.

04:24.460 --> 04:31.300
And you do this in N by turning on that switch that says require specific output format.

04:31.460 --> 04:35.540
And then you can give it a JSON example as I've given here.

04:35.740 --> 04:41.140
And when the LLM generates output it will need to conform to that structure.

04:41.140 --> 04:48.260
And it gives you this incredibly powerful way to put some kind of controls around what is otherwise

04:48.260 --> 04:50.140
very free flowing text.

04:50.140 --> 04:52.180
And you can use that in all sorts of ways.

04:52.180 --> 04:57.820
And in N-r10, it's particularly useful because you can use it to decide what to do next, knowing that

04:57.820 --> 05:00.380
you're going to get an output with a particular structure.

05:00.420 --> 05:03.140
Now, here's an interesting and important point.

05:03.300 --> 05:09.540
You will often find as you build workflows in N-r10, that there are actually two different ways that

05:09.540 --> 05:11.020
you could achieve the same thing.

05:11.180 --> 05:18.560
You could use tools, or alternatively, you could have your AI agent generate structured outputs and

05:18.560 --> 05:22.160
then interpret that output and make some decision as a result.

05:22.160 --> 05:26.880
And I think we did something a bit like that the first time we worked with Fire Crawl, we had that

05:26.880 --> 05:28.840
being and we outputted JSON.

05:28.840 --> 05:32.120
And then that went to some decisions that that called Fire Crawl.

05:32.120 --> 05:34.520
And then later we used a tool.

05:34.840 --> 05:37.320
And you'll often have those two different approaches.

05:37.320 --> 05:40.000
And you may end up thinking, I wonder which one is better.

05:40.280 --> 05:44.520
And you know, the answer is, of course, they have pros and cons, as with with many things.

05:44.520 --> 05:50.400
But but I will tell you, in my opinion, structured outputs is often the one to choose.

05:50.600 --> 05:56.560
It's the more boring answer tools is, the more the more trendy approach.

05:56.560 --> 05:59.520
It's the one where you're giving the most autonomy to your model.

05:59.560 --> 06:00.320
It's optional.

06:00.320 --> 06:04.160
Whether it uses the tool or not, it can have multiple tools.

06:04.160 --> 06:05.720
It can use any of them.

06:05.840 --> 06:08.120
It can choose what order it uses a tool in.

06:08.120 --> 06:09.960
It can call a tool multiple times.

06:10.160 --> 06:12.960
So there's much more flexibility with tools.

06:13.280 --> 06:18.630
But if you describe everything that you want Clearly in a JSON structure.

06:18.630 --> 06:23.790
And then you take that JSON structure and you use that to drive whatever happens next.

06:23.830 --> 06:30.270
That is a more kind of regimented, a more fixed way of doing things where you get to control how flexible

06:30.270 --> 06:33.590
it is or how inflexible it is in a lot of detail.

06:33.590 --> 06:40.710
And so I would describe the structured outputs alternative as the boring but bulletproof approach.

06:40.830 --> 06:46.950
And what I've built these things in production I have to I have to come clean that I almost always use

06:46.950 --> 06:53.190
the structured output style rather than too many tools, because you need something that is reliable.

06:53.310 --> 06:58.590
I would prioritize bulletproof over being being fashionable, so it's something to leave you with.

06:58.630 --> 07:03.230
You'll often find you have to make that decision, and you're wondering and you'll see what I mean about

07:03.270 --> 07:04.390
it being boring.

07:04.430 --> 07:06.470
You often have to do a bit more build work.

07:06.510 --> 07:07.830
It's quite repetitive.

07:07.950 --> 07:16.430
It's it reduces some of the magic of letting an AI agent choose its tools, but it gives you reliability

07:16.430 --> 07:17.510
as a result of that.

07:17.510 --> 07:19.950
And for me, that's the top priority.
