Understanding MCP Tools

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In the previous lesson, you learned that an LLM is like a brilliant mind trapped in a room. Tools are the hands that let it reach out and interact with the outside world.

You actually saw a tool in action during the very first example: the dog-age-to-human-age calculator.

When you asked the model to convert dog years, it didn’t try to guess the math based on its training data. Instead, it recognized that it had a specific tool designed for that exact purpose. It handed off the numbers to the tool, waited for the calculation, and presented the result back to you.

What Are Tools?

In the context of the Model Context Protocol (MCP), tools are executable functions that a server exposes to a host application. They allow the model to interact with external systems.

The Model is the Driver

It is important to understand the hierarchy of interaction in MCP. As a user, you do not call tools directly.

The Anatomy of a Tool

To the model, a tool isn’t magic; it’s a clearly defined schema. MCP uses JSON Schema to tell the model exactly what a tool does and what inputs it requires.

Human in the Loop

Because tools can perform actions—like modifying databases or sending emails—safety is a critical component of the protocol.

Setting Up Your Project

Now that you understand the theory, it is time to build. You will recreate the dog age calculator, but this time you will set it up in a dedicated project environment to prepare for deeper inspection.

See forum comments
Download course materials from Github
Previous: Setting Up MCP Inspector Next: Executing Tools with Inspector