Compare tools, resources, and prompts
Learn the three server primitives and who decides when each one is used.
- Choose whether a capability fits a tool, resource or prompt
- Explain who controls each primitive
- Name the requests a client uses for each
Servers offer three kinds of capability, and the key difference is who decides when to use them:
| Primitive | What it is | Controlled by | List / use |
|---|---|---|---|
| Tool | An action: search, create, send | The model decides to call it | tools/list, tools/call |
| Resource | Data to read, named by a URI: a file, a schema | The application decides what context to include | resources/list, resources/read |
| Prompt | A reusable template, often shown as a slash command | The user picks it | prompts/list, prompts/get |
The same underlying data can be offered more than one way: a database could expose a run_query tool and a schema://tables resource.
Try it
Up to 15 XPTool, resource or prompt?
For each capability, choose the primitive that fits best. Ask: is it an action, a piece of context, or a template the user picks?
“Create a calendar event”
“The contents of README.md”
““/review-pr” - a template asking for a thorough code review”
“Search the web for a phrase”
“A database’s table definitions”
““/summarize-meeting” with a transcript argument”
methods = {"tool": "tools/call", "resource": "resources/read", "prompt": "prompts/get"}
for kind, name in [("tool", "get_weather"), ("resource", "file:///notes.md"), ("prompt", "code_review")]:
print(methods[kind], name)tools/call get_weather resources/read file:///notes.md prompts/get code_review
Key takeaways
Tools are actions (model-controlled), resources are readable context (application-driven), prompts are templates (user-controlled).
Each has a
…/listrequest for discovery and its own request for use.A prompt or resource is not an access-control mechanism - authorization is separate.
Lesson quiz
7 questions · pass with 5 correct · up to 50 XP
Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.
Practice: build an MCP server
Write Python in the editor and run it against sample inputs. Python runs locally in your browser using a WebAssembly runtime.
Route capability requests
Each input line is a capability kind (tool, resource or prompt) and its name or URI. Print the request method a client uses to invoke it, followed by the name: tools/call NAME, resources/read URI or prompts/get NAME. Read lines until the input ends.
- One of each
- Two tools
Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.
Questions about this lesson
Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.
Loading posts…