Searching for mcp resources vs tools or mcp prompts vs tools usually means you already know how to list capabilities on a server and now need a sharper cut: which surfaces should be readable context the host can mount, which must be model-invoked actions with schemas and side-effect honesty, and which should be user-selected templates. Short answer—tools are model-controlled callable actions (often with side effects); resources are application-controlled URI-addressed context; prompts are user-controlled reusable templates (often slash commands / menus). Use resources for stable reference material; use tools for search, writes, and anything that changes state; use prompts when a human should pick a workflow up front. This page deepens the MCP server tutorial and MCP structured content · MCP server best practices—not a second intro, not an official MCP docs mirror.
01
Independence note
02
Definitions: MCP resources, tools, and prompts
All three primitives can live on the same server process and show up in host discovery. What separates them is who controls the next step—and what that implies for security and UX.
- Tools are actions the model (via the host) cancall. They take typed arguments, return structured results, and may have side effects: search that hits a live index, create a ticket, write a file, trigger a deploy hook. Treat them like a small, versioned adapter API—see naming and authz notes in best practices.
- Resources are URI-addressed pieces of context or data the host can read (and often attach or subscribe to). Think documentation chunks, config snapshots, schema catalogs, or project files exposed as
resource://…URIs. They are biased toward a read/data plane, not toward “do something.” - Prompts are reusable, often parameterized message templates the user (or host UI) selects—slash commands, menu entries, “start this workflow.” They can stitch resources and hint which tools matter, but they are not a substitute for tool schemas or resource URIs.
Mentally: tools are model-controlled verbs; resources are application-controlled nouns with addresses; prompts are user-controlled workflow starters. Hosts still decide how discovery and consent look— your job is to expose the right shape so the wrong path is hard.
// Illustrative — pin your SDK; shapes vary by release
// Tool: model calls with args → may mutate
server.tool("create_issue", { title: z.string().max(120) }, handler);
// Resource: host reads by URI → prefer read-only
server.resource("docs://onboarding", async () => ({
contents: [{ uri: "docs://onboarding", text: "…" }],
}));
// Prompt: user picks a named template (often with args)
server.prompt("triage_bug", { title: z.string() }, ({ title }) => ({
messages: [{ role: "user", content: { type: "text", text: "Triage: " + title } }],
}));03
MCP resources vs tools vs prompts (side by side)
| Dimension | Tools | Resources | Prompts |
|---|---|---|---|
| Who typically controls | Model (via host) | Application / host | User (UI / slash command) |
| Primary role | Callable actions / operations | Addressable context / data | Reusable workflow templates |
| How they are used | Invoked with arguments; expect a result | Read or mount content by URI | User selects; may fill args / stitch context |
| Side effects | Allowed and common | Prefer none; read plane | None by themselves; may lead into tools |
| Identity | Name + schema | URI (+ mime / metadata) | Name + optional argument schema |
| Best fit | Search, mutate, trigger workflows | Stable docs, catalogs, large shards | Guided jobs: triage, summarize, draft |
| Failure mode if misused | Wrong tool / duplicate mutations | Stale or oversized context | Hidden “do work” APIs; unused menus |
If a capability needs arguments that change what happens next, or can mutate shared state, it belongs on the tool side. If the value is “here is text/bytes the session should see,” lean resource. If a human should deliberately start a named workflow, lean prompt—then let tools and resources do the heavy lifting underneath.
04
When to use which
- Stable reference material. Onboarding notes, API field glossaries, house style that changes slowly—expose as resources (optionally chunked by URI) so hosts can mount context without inventing a
get_docstool for every paragraph. - Large documents that need sharding. Split by chapter or path into multiple resource URIs. Prefer fetch-what-you- need over stuffing a megabyte into a single tool result.
- Host-mounted project context. When the IDE/host should attach “current config” or “schema snapshot” as background reading, resources fit better than forcing the model to call a read tool every turn.
- Search, filters, and live queries. Anything whose interesting part is the arguments (query string, filters, tenant id) is a tool—even if the outcome is “just text.”
- Writes and side effects. Create, update, delete, send, charge, deploy: always tools, with schemas, authz, timeouts, and idempotency where retries hurt. Never hide a write behind a resource read.
- User-started workflows. “Triage this bug,” “Draft a release note,” “Explain this schema”—when a human should pick the job from a menu or slash command, expose an MCP prompttemplate. Keep the prompt thin: gather args, point at resources, and let tools perform side effects. Do not hide mutations inside a prompt-only surface.
- Mixed flows. Common pattern: resources for the catalog (what exists), tools for operations on a chosen id, prompts for the human-facing entry. Keep the URI/id vocabulary consistent so session briefs stay short—see also good agent prompt for session-level tool policy.
05
Anti-patterns
- Everything is a tool. Wrapping static README text as
get_readmeburns tool-selection attention and duplicates what a resource URI could mount once. Reserve tools for decisions and actions. - Mutable state as a resource. Exposing “current cart” or “draft PR body” as a casually updatable resource blurs the audit story. Prefer an explicit tool for each mutation, and a read resource (or read tool) for the snapshot.
- God-tool that returns your whole product. One
runtool with a free-form command string is not a design—it is remote code execution with extra steps. Same critique applies to a single resource that dumps the entire database. - Duplicate surfaces. Shipping both
docs://xandget_doc(x)with divergent content guarantees drift. Pick one primary; if you need both, make the tool a thin fetch of the same store the resource uses. - Side effects in “read” names. A resource or
get_*tool that quietly sends email teaches the model the wrong priors. Name and document effects honestly. - Prompts as secret tools. A “prompt” that only exists so the model can mutate state without a tool schema skips consent and audit. User-selected templates should compose tools—not replace them.
- Everything is a prompt menu. Dumping dozens of near-duplicate slash commands creates the same selection pressure as a bloated tool catalog. Curate workflows humans actually start.
06
Design tips
- Start from user jobs: what must be read vs done?
- Give resources stable, boring URIs; version breaking content in the path or metadata.
- Keep tool names verb_noun; keep resource URIs noun-like and hierarchical.
- Cap payload sizes on both paths; shard large docs instead of one giant blob.
- Authorize reads too—resources can still leak tenants if you skip checks.
- Log tool calls with outcomes; treat resource fetches as data-plane access in audits.
- Document the split in your server README so contributors do not “just add another tool” (or another unused prompt).
- For prompts: name the user job, keep argument lists short, and link the tools/resources the workflow needs.
First-time wiring still belongs in the tutorial; hardening schemas, least privilege, and ops belong in best practices. This page settles the resources / tools / prompts fork.
07
MCP resource templates (parameterized URIs)
Searching for mcp resource templates usually means URI templates with parameters—not another restatement of “resources vs tools.” A static resource is a fixed URI (docs://onboarding). A resource templatedeclares a pattern such as tickets://{id} so hosts can discover the shape and fill parameters before reading. Prefer templates when the set is large or open-ended; prefer static resources when the catalog is small and human-curated.
- Use a template for per-entity reads (ticket by id, file by path under an allowlist, customer record by key) where listing every URI would explode.
- Use a static resource for hand-picked reference packs (style guide, architecture overview, onboarding shard).
- Still use a tool when the call mutates state, needs rich args beyond URI params, or is a search with ranking—not a fetch-by-key.
Official SDK examples remain the API source of truth; this section is selection judgment for when templates earn their keep versus static resources or tools.
08
MCP Roots deprecated — what to use instead
Searching for mcp roots deprecated usually means a host or SDK upgrade removed or soft-deprecated the Roots capability (workspace root negotiation). For new designs, prefer:
- Resources for readable workspace context the host can mount or fetch by URI—see the definitions above.
- Explicit path parameters on tools (with server-side path validation and allowlists) when the model must target a file or directory.
- Do not invent a second “roots-compatible” shim that bypasses authz; treat path args like any other untrusted input.
10
FAQ
What is the difference between MCP resources and tools?
Tools are model-callable actions with schemas—they may have side effects. Resources are URI-addressed context or data, biased toward reading and host-mounted reference material. Use tools to do work; use resources to supply stable context.
How do MCP prompts differ from tools (and resources)?
Prompts are user-controlled templates—often slash commands or menu entries—that start a guided workflow. Tools are model-controlled actions; resources are application-controlled context. Use a prompt when a human should deliberately pick the job; still expose mutations as tools and reference material as resources underneath.
When should I expose something as a resource instead of a tool?
When the value is readable reference data the host can mount or fetch by URI—docs, catalogs, config snapshots, large text shards—and it does not need per-call arguments that change behavior. Live search and any write stay on tools.
Can a resource have side effects?
Prefer no. Treat the resource plane as read-oriented. Any durable mutation should go through a tool with validation and authorization. If a host supports writable resources, apply the same checks you would on a mutating tool.
Are MCP Roots deprecated—what should I use instead?
Protocol revisions deprecate the Roots capability for many new designs. Prefer ordinary resources for workspace context and/or explicit path parameters on tools, with server-side path validation. Confirm against your pinned revision.
When should I use MCP resource templates?
Use parameterized URI templates when entities are numerous or open-ended (ticket by id, record by key). Prefer static resources for small curated packs. Mutations and rich queries stay on tools. See resource templates.
Is this official MCP documentation?
No. This is an unofficial engineering comparison on codemo.fun (墨码 / codemo). Protocol details and SDK APIs remain defined by upstream MCP docs and your host vendor—re-check after upgrades.