evipedia-mcp-dev 0.1.22 → 0.1.24
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 +6 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -82,14 +82,14 @@ async function searchReviews(query, limit = 20) {
|
|
|
82
82
|
const bySlug = new Map(reviewsIndex.map((r) => [toSlug(r.permalink).toLowerCase(), r]));
|
|
83
83
|
const byUrl = new Map(searchIndex.map((e) => [e.url, e]));
|
|
84
84
|
const idx = buildLunrIndex(searchIndex);
|
|
85
|
-
const
|
|
86
|
-
return
|
|
85
|
+
const hits = runLunrQuery(idx, query).slice(0, limit);
|
|
86
|
+
return hits.map((res) => {
|
|
87
87
|
const review = bySlug.get(toSlug(res.ref).toLowerCase());
|
|
88
88
|
if (review) {
|
|
89
|
-
return {
|
|
89
|
+
return { topic: review.canonical_topic.replace(/ for Health & Longevity$/, ""), url: review.permalink };
|
|
90
90
|
}
|
|
91
91
|
const e = byUrl.get(res.ref);
|
|
92
|
-
return {
|
|
92
|
+
return { topic: e?.short_topic ?? res.ref, url: e?.url ?? res.ref };
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
function createServer() {
|
|
@@ -99,15 +99,14 @@ function createServer() {
|
|
|
99
99
|
);
|
|
100
100
|
server2.tool(
|
|
101
101
|
"search_reviews",
|
|
102
|
-
"Search evipedia.ai evidence reviews by name, synonym, keyword, or category.
|
|
102
|
+
"Search evipedia.ai evidence reviews by name, synonym, keyword, or category. A discovery tool: returns the matching reviews (goal-qualified topic + URL) ranked by relevance so you can tell whether a review exists. To read one, pass its slug to get_conclusion (quick bottom line) or get_review (full Markdown).",
|
|
103
103
|
{ query: z.string().describe("Search query \u2014 intervention name, synonym, drug class, or category") },
|
|
104
104
|
async ({ query }) => {
|
|
105
105
|
const matches = await searchReviews(query);
|
|
106
106
|
if (matches.length === 0) {
|
|
107
107
|
return { content: [{ type: "text", text: "No reviews found." }] };
|
|
108
108
|
}
|
|
109
|
-
const text = matches.map((m) =>
|
|
110
|
-
${m.conclusion}` : `**${m.name}** \u2014 ${m.url}`).join("\n\n---\n\n");
|
|
109
|
+
const text = matches.map((m) => `**${m.topic}** \u2014 ${m.url}`).join("\n");
|
|
111
110
|
return { content: [{ type: "text", text }] };
|
|
112
111
|
}
|
|
113
112
|
);
|