evipedia-mcp-dev 0.1.27 → 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 +15 -16
- 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,7 +41,7 @@ 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. 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?")
|
|
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.
|
|
43
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.
|
|
44
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.
|
|
45
47
|
|
|
@@ -125,33 +127,30 @@ function createServer() {
|
|
|
125
127
|
);
|
|
126
128
|
server2.tool(
|
|
127
129
|
"list_updates",
|
|
128
|
-
"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.
|
|
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.",
|
|
129
131
|
{
|
|
130
|
-
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
|
|
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.")
|
|
131
133
|
},
|
|
132
134
|
async ({ days }) => {
|
|
133
135
|
const updates = await fetchCached(`${BASE_URL}/updates.json`);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
rows = [...rows].sort((a, b) => b.date.localeCompare(a.date));
|
|
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
140
|
const list = rows.map((u) => ({
|
|
141
141
|
title: u.title,
|
|
142
142
|
slug: toSlug(u.permalink),
|
|
143
143
|
status: u.status,
|
|
144
144
|
date: u.date
|
|
145
145
|
}));
|
|
146
|
+
const window = windowDays === 1 ? "day" : `${windowDays} days`;
|
|
146
147
|
if (list.length === 0) {
|
|
147
|
-
return {
|
|
148
|
-
content: [{
|
|
149
|
-
type: "text",
|
|
150
|
-
text: days !== void 0 ? `No reviews published or updated in the last ${days === 1 ? "day" : `${days} days`}.` : "No updates found."
|
|
151
|
-
}]
|
|
152
|
-
};
|
|
148
|
+
return { content: [{ type: "text", text: `Nothing has been published or updated on evipedia in the last ${window}.` }] };
|
|
153
149
|
}
|
|
154
|
-
|
|
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 }] };
|
|
155
154
|
}
|
|
156
155
|
);
|
|
157
156
|
server2.tool(
|