If you have thousands of records (e.g., Jira tickets), you cannot register 10,000 static Resources. Instead, you use Resource Templates.
server.resourceTemplate(
"issue-ticket",
"jira://issue/{key}",
{ description: "Load a Jira ticket by key" },
async (uri, { key }) => {
const ticketData = await fetchJira(key);
return {
contents: [{
uri: uri.href,
text: JSON.stringify(ticketData)
}]
};
}
);
The AI can infer that if it wants ticket PROJ-123, it should request the URI jira://issue/PROJ-123.