Resource Fundamentals — Resources
← Back to Dashboard
1. Resource Fundamentals2. Resource Templates3. Pagination & Subscriptions
Resource Fundamentals
Resources are Read-Only Data
Unlike Tools (which do things), Resources expose data for the AI to inspect. Think of them as files, database rows, or standard operating procedures.
Defining a Static Resource
server.registerResource(
"company-handbook", // Name
"file:///docs/handbook.md", // URI
{ title: "Company Handbook", description: "HR Policies", mimeType: "text/markdown" },
async (uri) => {
return {
contents: [{
uri: uri.href,
text: "Handbook contents go here..."
}]
};
}
);
All Resources are identified by a URI. The client can fetch the exact content of the resource via string paths.
⌨ HANDS-ON LABList Server Data Resources
⭐ +125 XPDiscover available data resources using the resources/list protocol method.
1List resources exposed by server-filesystem using inspector CLI.
OBJECTIVE 1 / 1 — type "hint" if stuck
🧪 Knowledge Check
Press 1-4 to select1 of 3
What is the primary difference between a Tool and a Resource?
Tools are dynamic actions; Resources are read-only data blocks.
Tools require internet; Resources are local.
Resources use JSON; Tools use XML.
Tools cost money; Resources are free.