Tools Do Things, Resources Provide Context
Here's the quick version: a tool is something the AI model calls to perform an action. A resource is something the model reads to get context. The distinction sounds academic until you're building an MCP server and need to decide which pattern to use.
A database query is a tool. You're asking the server to do something (execute a query) and return the result. A database schema description is a resource. You're giving the model information it can reference while deciding what queries to write. The query changes based on what the user asks. The schema stays the same regardless.
Why the Distinction Matters
Resources get loaded into the model's context automatically when the server connects. Tools get called only when the model decides they're needed. This means resources add to the model's baseline knowledge without requiring a tool call, which saves tokens and reduces latency.
If you put your database schema as a tool ("call this to get the schema"), the model has to spend a turn calling it before it can write queries. If you put it as a resource, the model already knows the schema from the moment the server connects. For information that's relatively static and useful across many interactions, resources are more efficient.
But resources also consume context space permanently. A large resource (like a complete API reference) eats into the model's context window for the entire conversation. If the information is only needed occasionally, a tool that fetches it on demand is more context-efficient.
Common Design Mistakes
The most common mistake is putting everything as tools. New MCP server developers tend to make every capability a tool, including things like "get the list of available tables" or "get the server configuration." These are better as resources because they don't change during a conversation and the model benefits from having them always available.
The opposite mistake is less common but also problematic: putting dynamic data as resources. If a resource changes frequently (like a live dashboard or a real-time metric), the model's cached version becomes stale, and the user gets outdated information without realizing it.
A Practical Rule of Thumb
If it changes between conversations, it's probably a resource (schema, configuration, help text). If it changes based on user input, it's a tool (queries, writes, searches). If it changes in real time, it's definitely a tool, because the model needs the current value each time it asks.
When you're building your own MCP server, think about what information the model needs to have "just by knowing" versus what it needs to "go get." That intuition maps directly to the resource vs tool decision.
Related Reading
- What the Model Context Protocol Actually Does
- How MCP Servers Differ from Traditional APIs
- Building an MCP Server from Scratch with the TypeScript SDK
Browse MCP servers on Skillful.sh. Search 137,000+ AI tools.