MCP primitives: tools, resources, and prompts
Everything a server offers falls into a small set of primitives. Knowing which is which tells you how it will be used and who controls it.
Tools (model-controlled) #
Tools are functions the model can call to take an action or fetch computed data: create an issue, run a query, send a message. Each has a name, a description, and a JSON Schema for its inputs. The model decides when to call a tool, which is why tool descriptions matter so much, they are how the model knows what a tool is for.
A tool definition, as a server returns it, looks like this:
json{
"name": "create_issue",
"description": "Open a GitHub issue. Use this when the user asks to file a bug or feature request.",
"inputSchema": {
"type": "object",
"properties": {
"repo": { "type": "string", "description": "owner/name, e.g. acme/store" },
"title": { "type": "string" },
"body": { "type": "string" }
},
"required": ["repo", "title"]
}
}
Resources (application-controlled) #
Resources are data the server can expose for context: a file, a database row, a document, a log. They are identified by URI and are meant to be read, not to cause side effects. The host application decides which resources to pull into the model's context, rather than the model calling them like a function.
Prompts (user-controlled) #
Prompts are reusable, parameterized message templates the server offers, often surfaced as slash commands or menu items. They are user-controlled: a person picks a prompt to start a workflow. Think of them as curated starting points a server author ships alongside its tools.
Client capabilities: sampling, roots, elicitation #
The protocol is bidirectional. A server can also ask things of the client:
- Sampling lets a server request a model completion from the client, so a server can use the model without holding its own API key.
- Roots let the client tell the server which files or directories it is allowed to operate within.
- Elicitation lets a server ask the user for additional input mid-operation, through the client's UI.
If the model decides to invoke it, it is a tool. If the application supplies it as context, it is a resource. If the user picks it, it is a prompt.
Resources & further reading
- MCP specification MCPThe authoritative protocol spec: messages, capabilities, transports, and lifecycle.
- modelcontextprotocol.io MCPThe official Model Context Protocol site: concepts, quickstarts, and client list.