Tools & the Model Context Protocol
What turns a language model into an agent that can actually do things.
An LLM on its own can only produce text. To act β read a file, query an API, restart a service β it needs tools. The Model Context Protocol (MCP) is an open standard for connecting models to those tools and data sources in a consistent way. Together they turn a chatbot into a capable agent.
π― Learning Objectives
By the end of this lesson you will:
- Understand what βtoolsβ mean for an AI model
- Follow how a model decides to call a tool
- Understand what MCP is and the problem it solves
- Know the client/server roles in MCP
What Is a Tool?
A tool is a function the model is allowed to call. You describe it β its name, what it does, and its inputs β and the model can choose to invoke it during its reasoning.
{
"name": "get_pod_logs",
"description": "Fetch recent logs for a Kubernetes pod",
"parameters": {
"pod_name": "string",
"lines": "number"
}
}Given this description, the model can decide when to call get_pod_logs, with what arguments β and then reason over the result.
The Tool-Calling Flow
1. Model decides: "I need the logs for web-abc"
2. Model emits: get_pod_logs(pod_name="web-abc", lines=50)
3. Your code runs the real function
4. Result returned to the model
5. Model reasons over the logs and respondsThe crucial point: the model doesnβt run anything itself. It requests a tool call; your code executes it and returns the result. That boundary is where you enforce security and permissions.
β The model requests, you control
Never let a model directly execute commands. It should only ask to call a defined tool; your code validates the request, applies permissions, runs it, and returns the result. This boundary is your primary safety control.
The Problem MCP Solves
Before MCP, every AI app connected to every tool in its own custom way. Ten apps Γ ten tools meant a hundred bespoke integrations β brittle and duplicated.
MCP standardises this. Build an MCP server for a system once (say, a GitHub server or a Kubernetes server), and any MCP-compatible AI app can use it. Itβs often described as βUSB-C for AIβ β one standard connector.
Without MCP: every app β every tool (N Γ M custom integrations)
With MCP: apps ββ ββ tools
ββ MCP standard βββ€
β ββMCP Client and Server
MCP follows a simple client/server model:
| Role | What it is |
|---|---|
| MCP Server | Exposes tools, data, and prompts for one system (files, GitHub, a database) |
| MCP Client | The AI application that connects to servers and uses their tools |
An MCP server can offer three things:
- Tools β actions the model can call (e.g.
create_issue). - Resources β data the model can read (e.g. a fileβs contents).
- Prompts β reusable prompt templates for common tasks.
π‘ Why this matters for DevOps
MCP means you can wire an agent to your real toolchain β Git, cloud APIs, monitoring, ticketing β through standard servers, instead of gluing together one-off integrations. Thatβs what makes practical, tool-using DevOps agents feasible.
π§ͺ Hands-on Lab
Define Tools for a DevOps Agent
- Describe three tools an incident-response agent would need
- For each, write its name, description, and parameters
- Note which tool is read-only and which is destructive (and needs approval)
π§ Knowledge Check
When a model 'calls a tool', what actually happens?
What problem does the Model Context Protocol (MCP) solve?
πΌ Interview Preparation
Explain how an AI agent safely interacts with real systems through tools and MCP.
Summary
You now understand how tools give a model the power to act, the request/execute safety boundary, and how MCP standardises connecting AI to real systems. Next, we bring it all together with practical, safe uses of agentic AI across DevOps.