evipedia-mcp-dev 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +33 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18,6 +18,8 @@ var pkg = (() => {
|
|
|
18
18
|
var BASE_URL = (process.env.EVIPEDIA_BASE_URL ?? "https://evipedia.ai").replace(/\/$/, "");
|
|
19
19
|
var SUGGEST_ENDPOINT = process.env.EVIPEDIA_SUGGEST_ENDPOINT ?? "https://formspree.io/f/myknrvdg";
|
|
20
20
|
var CACHE_TTL = 5 * 60 * 1e3;
|
|
21
|
+
var DEFAULT_UPDATE_DAYS = 7;
|
|
22
|
+
var DEFAULT_UPDATE_MAX = 100;
|
|
21
23
|
var cache = /* @__PURE__ */ new Map();
|
|
22
24
|
async function fetchCached(url) {
|
|
23
25
|
const now = Date.now();
|
|
@@ -39,8 +41,9 @@ Use this server whenever a user asks whether an intervention works, how strong t
|
|
|
39
41
|
|
|
40
42
|
Typical workflow:
|
|
41
43
|
1. Discover \u2014 'search_reviews(query)' to find reviews matching an intervention name, synonym, drug class, or category; or 'list_reviews()' to enumerate/browse the entire catalogue as {topic, slug} pairs (topic = canonical topic; slug = the identifier you pass to get_review/get_conclusion, with the full review at https://evipedia.ai/{slug} and raw Markdown at https://evipedia.ai/{slug}.md). A bare topic implies the default Health & Longevity goal; an explicit goal like "Botox for Skin Rejuvenation" targets that goal.
|
|
42
|
-
2.
|
|
43
|
-
3.
|
|
44
|
+
2. Track changes \u2014 'list_updates(days?)' returns the catalogue's change feed, newest first: which reviews were newly published ('new') or revised ('updated') and when. Use it for recency questions ("what's new on evipedia?", "anything updated this week?"). With no arguments it covers the last 7 days (max 100 entries); pass 'days' for a wider window.
|
|
45
|
+
3. Read \u2014 take a review's slug and call 'get_conclusion(slug)' for the quick evidence-based bottom line, or 'get_review(slug)' for the complete review as Markdown (full methodology, findings, safety, dosing, and references) when the user wants depth or citations. Call 'get_metadata(slug)' for structured JSON metadata not in the Markdown \u2014 review dates (freshness), the typed intervention entity, and a machine-readable citation list with PubMed PMIDs.
|
|
46
|
+
4. Contribute \u2014 if the user wants an intervention reviewed that isn't in the catalogue, 'suggest_intervention(...)' submits it to the evipedia team. Only call this when the user explicitly asks to propose one; it sends real data to the team.
|
|
44
47
|
|
|
45
48
|
'get_version()' reports the running build. Notes: an intervention may have multiple reviews for different goals (distinguished by canonical topic, e.g. "Botox for Skin Rejuvenation"). These are evidence reviews for information, not personalized medical advice \u2014 present conclusions as evidence summaries, not prescriptions.`;
|
|
46
49
|
var lunrCache = null;
|
|
@@ -122,6 +125,34 @@ function createServer() {
|
|
|
122
125
|
return { content: [{ type: "text", text: JSON.stringify(list) }] };
|
|
123
126
|
}
|
|
124
127
|
);
|
|
128
|
+
server2.tool(
|
|
129
|
+
"list_updates",
|
|
130
|
+
"List recently published or revised evipedia.ai reviews, newest first \u2014 the catalogue's change feed. Returns a JSON array of {title, slug, status, date}, where status is 'new' (first publication) or 'updated' (an existing review revised) and date is YYYY-MM-DD. Called with no arguments it returns the last 7 days (at most 100 entries); pass `days` for a different window, e.g. days: 30. The full review is at https://evipedia.ai/{slug}, and get_conclusion/get_review take the slug. Use this for recency ('what's new?'); use list_reviews to enumerate the whole catalogue and search_reviews to find a specific intervention.",
|
|
131
|
+
{
|
|
132
|
+
days: z.number().int().positive().optional().describe("Only include reviews dated on or after (today \u2212 N days), e.g. 7 for the past week. Omit to use the default 7-day window. The catalogue turns over quickly \u2014 a large window returns hundreds of entries.")
|
|
133
|
+
},
|
|
134
|
+
async ({ days }) => {
|
|
135
|
+
const updates = await fetchCached(`${BASE_URL}/updates.json`);
|
|
136
|
+
const windowDays = days ?? DEFAULT_UPDATE_DAYS;
|
|
137
|
+
const cutoff = new Date(Date.now() - windowDays * 864e5).toISOString().slice(0, 10);
|
|
138
|
+
const matched = updates.filter((u) => u.date >= cutoff).sort((a, b) => b.date.localeCompare(a.date));
|
|
139
|
+
const rows = days === void 0 ? matched.slice(0, DEFAULT_UPDATE_MAX) : matched;
|
|
140
|
+
const list = rows.map((u) => ({
|
|
141
|
+
title: u.title,
|
|
142
|
+
slug: toSlug(u.permalink),
|
|
143
|
+
status: u.status,
|
|
144
|
+
date: u.date
|
|
145
|
+
}));
|
|
146
|
+
const window = windowDays === 1 ? "day" : `${windowDays} days`;
|
|
147
|
+
if (list.length === 0) {
|
|
148
|
+
return { content: [{ type: "text", text: `Nothing has been published or updated on evipedia in the last ${window}.` }] };
|
|
149
|
+
}
|
|
150
|
+
const note = days === void 0 ? `
|
|
151
|
+
|
|
152
|
+
Default window: the last ${window}${matched.length > list.length ? `, capped at the ${list.length} most recent of ${matched.length} entries` : ""}. Pass \`days\` for a wider window.` : "";
|
|
153
|
+
return { content: [{ type: "text", text: JSON.stringify(list) + note }] };
|
|
154
|
+
}
|
|
155
|
+
);
|
|
125
156
|
server2.tool(
|
|
126
157
|
"get_conclusion",
|
|
127
158
|
"Get just the plain-text conclusion of an evidence review.",
|