List vs Templated Resources
Offer fixed entries plus on-the-fly patterns.
List vs Templated Resources is a free MCP Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Two Ways to Offer Data
MCP exposes data two ways: a listed resource with a fixed URI, or a templated one with placeholders. Knowing which to pick keeps your server clear.
Listed: Enumerable and Few
A listed resource has a concrete URI and shows up in resources/list. Use it when there are only a handful of known items the client can browse.
@mcp.resource("config://app")
def app_config() -> str:
return read_config()Templated: Infinite by Pattern
A templated resource uses curly-brace placeholders, so it covers countless URIs. It can't be listed in full, because the set is open-ended.
@mcp.resource("file://{path}")
def read_file(path: str) -> str:
return open(path).read()The Listing Difference
Clients call resources/list to discover fixed resources. Templates appear in a separate templates list instead, advertising the shape rather than concrete entries.
Browse vs Address
Think of it as browse vs address. Listed resources are like menu items you scan; templates are like typing an address you already know.
When the Set Is Small
If your data is a short, stable set, prefer listed resources. The model can see every option, which makes the right choice obvious to it.
When the Set Is Huge
If items number in the thousands, a template wins. Listing them all would flood the client, so you advertise the pattern and let it fill in values.
weather://{city}/todayCombine Both Freely
A real server often does both: a few listed entries for common data, plus templates for the long tail. They coexist happily side by side.
Help Discovery Along
Templates can't enumerate, but you can add a small listed index resource that points to popular URIs, giving the model useful starting points.
@mcp.resource("cities://index")
def cities() -> str:
return "london, paris, tokyo"Same Read, Either Way
However a URI is found, the client reads it the same way: one resources/read call. Listed or templated changes discovery, not how content is fetched.
Why This Matters
Choosing listed vs templated shapes how easily a model finds your data. Pick listed for browsing, templated for scale, and your server stays usable. 🎯
Quick Check
Which resource type should you use for thousands of items?
Recap
You learned that listed resources suit small browsable sets while templated ones scale to huge collections, and the two combine well. Next: notifying clients of updates. 🚀
Frequently asked questions
Is the “List vs Templated Resources” lesson free?
Yes — the full text of “List vs Templated Resources” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.
What will I learn in “List vs Templated Resources”?
Offer fixed entries plus on-the-fly patterns. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start MCP Academy?
No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “List vs Templated Resources” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this MCP Academy lesson?
Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Parameterized Resource URIs
- Build Content at Read Time
- List vs Templated Resources
- Notify Clients of Updates