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