What is the difference between direct and templated MCP resources?
Defining MCP Resources for Data Access
Audio flashcard · 0:30Nortren·
What is the difference between direct and templated MCP resources?
0:30
There are two types of resources. Direct resources have static URIs that never change. They are perfect for operations that do not need parameters, like getting the full list of documents. Templated resources include parameters in their URIs, like a URI that contains a document ID placeholder. The Python SDK automatically parses those parameters out of the URI and passes them as keyword arguments to your function. So you write a single function for fetch document by ID, register it with a templated URI, and the SDK dispatches every matching request to your function with the parsed arguments.
modelcontextprotocol.io