DS DevShelfHub Projects · AI tools
Tutorials / MCP / Primitives
MCP Beginner · 7 min read Page 6 of 23

The Three MCP Primitives

By DevShelfHub

Every MCP server exposes one or more of three building blocks: Tools, Resources, and Prompts. Learn when to use each and how they differ.

Series progress6 / 23

What are the primitives?

MCP defines three core building blocks that servers expose. Think of them as three different ways to extend what an AI can do:

🔧 Tools — Actions the AI can take

Tools are callable functions. The AI model reads the tool definition and decides when to call it based on the user's request.

Example: A "run_shell_command" tool that the AI can call to execute bash commands. Or a "search_google" tool that performs web searches.

When to use: When you want the AI to perform actions or retrieve information on-demand.

📚 Resources — Data the AI can read

Resources are static or semi-dynamic data that the Host can provide to the model context. The AI doesn't "call" a resource — the Host shows it proactively.

Example: A file system resource that lists files in a directory. Or a GitHub resource that shows recent commits in a repo. Or a company knowledge base resource.

When to use: When you want to make large datasets or documents available for the AI to reference without making separate function calls.

💬 Prompts — Reusable prompt templates

Prompts are pre-built, reusable instructions that the Host can use. They're like templates — parameterised prompts that serve as a standardised way to invoke common workflows.

Example: A "code_review" prompt that accepts a code snippet and returns best-practice feedback. Or a "customer_support_classifier" prompt that categorizes support tickets.

When to use: When you want to standardise how certain tasks are performed and make those patterns reusable and versionable.

Side-by-side comparison

Tools Resources Prompts
Purpose Actions Data Instructions
Invoked by AI model decision Host automatically Host or user
Example run_shell_command read_file, list_files code_review, classify_ticket

Quick summary

  • Tools: Functions the AI calls when it decides to take action
  • Resources: Data the Host provides for the AI to reference
  • Prompts: Reusable instruction templates exposed by servers
  • A single MCP server can expose any combination of these primitives

MCP Primitives FAQ

What are the three MCP primitives?

The three MCP primitives are Tools (model-controlled actions that execute code), Resources (application-controlled data exposed for context), and Prompts (user-controlled templates that standardise common workflows).

What is an MCP Tool?

An MCP Tool is a function a server exposes that the AI model can call to perform an action — run a query, call an API, write a file. The model decides when to call it based on the conversation context.

What is an MCP Resource?

An MCP Resource exposes data — files, database rows, API responses — that the application (not the model) includes in context. Resources support static URIs and URI templates, and can be subscribed to for live updates.

What is an MCP Prompt?

An MCP Prompt is a reusable template that a user or application can invoke. It accepts named arguments and returns a pre-filled message list, making it easy to standardise common workflows like code review or bug report generation.

When should I use a Tool vs a Resource?

Use a Tool when the AI model needs to take an action or call external APIs. Use a Resource when you want to expose data for the application to include in context automatically, without the model having to call anything.

Quick jump: API Reference