Loading
0x10Lesson 2 of 16

Compare tools, resources, and prompts

Learn the three server primitives and who decides when each one is used.

16 min 7-question quiz 1 code exercise
By the end of this lesson you can
  • 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:

PrimitiveWhat it isControlled byList / use
ToolAn action: search, create, sendThe model decides to call ittools/list, tools/call
ResourceData to read, named by a URI: a file, a schemaThe application decides what context to includeresources/list, resources/read
PromptA reusable template, often shown as a slash commandThe user picks itprompts/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 XP

Tool, 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?

0 of 6 sortedScore 0/0
  • “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”

route.py
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)
Output
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 …/list request 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.

Exercise 1

Route capability requests

+25 XP

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
main.py
Loading editor…

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…