← 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.resource(
"company-handbook", // Name
"file:///docs/handbook.md", // URI
{ description: "HR Policies" }, // Metadata
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.
🧪 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.