COMPLETE guide to MCP tools, resources, and prompts. Learn what each primitive controls, how they differ, and when to use each. Comparison table included.
Frequently Asked Questions
What are the three core primitives of the Model Context Protocol?
The three server-side MCP primitives are Tools (executable functions the model invokes autonomously), Resources (read-only data the application injects into context), and Prompts (reusable templates the user explicitly triggers). Each is controlled by a different actor: the model, the application, and the user respectively.
What is the difference between MCP tools and MCP resources?
MCP tools are executable functions with potential side effects — the model calls them autonomously to take action. MCP resources are read-only data sources (files, schemas, logs) that the application includes in context. Use a tool when you need to act; use a resource when you just need to inform the model.
When should I use a prompt vs. a tool in an MCP server?
Use a Prompt when you want to give users a reusable, parameterized template they explicitly invoke (like a slash command). Use a Tool when you want the model to autonomously decide to call a function based on context. Prompts are user-initiated; tools are model-initiated.
What is MCP sampling and how does it relate to the core primitives?
Sampling is a client-side primitive that lets MCP servers request LLM completions from the host client, reversing the normal flow. It enables servers to run sub-agent reasoning inside tool workflows without needing their own API keys — a key building block for agentic behaviors.
Are MCP resources read-only?
Yes. MCP resources are read-only by design. They represent contextual data the server exposes for the model to reference but not modify. If you need to mutate state, that is what tools are for. The read-only constraint makes resources safe to inject into context without unintended side effects.