Tools, Resources, and Prompts
The three primitives MCP exposes and how a model uses each one to interact with external systems.
MCP exposes three core primitives: tools, resources, and prompts. Tools are executable actions the model decides to invoke. Resources are readable data the host can attach to context, usually without the model deciding anything. Prompts are reusable instruction templates the user (not the model) selects.
# A tool: the model decides when to call this, with what arguments
Tool(
name="run_query",
description="Run a read-only SQL query against the database",
inputSchema={
"type": "object",
"properties": {"sql": {"type": "string"}},
"required": ["sql"],
},
)
# A resource: no arguments, no model decision, just an addressable
# piece of context the host can fetch and inject directly
Resource(
uri="postgres://schema",
name="Database Schema",
description="Full schema of all public tables",
mimeType="text/plain",
)Notice the resource has no `inputSchema`. It is not something the model calls with arguments, it is something the host reads and hands to the model as context, the same way you might paste a file into a prompt. This is why schema discovery works well as a resource (`postgres://schema` in the companion Postgres server) while running a query works well as a tool.
Think of MCP as a control panel. Tools are buttons, resources are display screens, and prompts are saved operating procedures.