evipedia-mcp-dev 0.1.23 → 0.1.25
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 +4 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53,7 +53,6 @@ function buildLunrIndex(searchIndex) {
|
|
|
53
53
|
this.field("short_topic", { boost: 15 });
|
|
54
54
|
this.field("alternate_names", { boost: 10 });
|
|
55
55
|
this.field("ep_keywords", { boost: 8 });
|
|
56
|
-
this.field("ep_category", { boost: 3 });
|
|
57
56
|
for (const doc of searchIndex) this.add(doc);
|
|
58
57
|
});
|
|
59
58
|
lunrCache = { key: searchIndex, idx };
|
|
@@ -86,10 +85,10 @@ async function searchReviews(query, limit = 20) {
|
|
|
86
85
|
return hits.map((res) => {
|
|
87
86
|
const review = bySlug.get(toSlug(res.ref).toLowerCase());
|
|
88
87
|
if (review) {
|
|
89
|
-
return {
|
|
88
|
+
return { topic: review.canonical_topic.replace(/ for Health & Longevity$/, ""), url: review.permalink };
|
|
90
89
|
}
|
|
91
90
|
const e = byUrl.get(res.ref);
|
|
92
|
-
return {
|
|
91
|
+
return { topic: e?.short_topic ?? res.ref, url: e?.url ?? res.ref };
|
|
93
92
|
});
|
|
94
93
|
}
|
|
95
94
|
function createServer() {
|
|
@@ -99,14 +98,14 @@ function createServer() {
|
|
|
99
98
|
);
|
|
100
99
|
server2.tool(
|
|
101
100
|
"search_reviews",
|
|
102
|
-
"Search evipedia.ai evidence reviews by name, synonym, keyword, or category. A discovery tool: returns the matching reviews (
|
|
101
|
+
"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
102
|
{ query: z.string().describe("Search query \u2014 intervention name, synonym, drug class, or category") },
|
|
104
103
|
async ({ query }) => {
|
|
105
104
|
const matches = await searchReviews(query);
|
|
106
105
|
if (matches.length === 0) {
|
|
107
106
|
return { content: [{ type: "text", text: "No reviews found." }] };
|
|
108
107
|
}
|
|
109
|
-
const text = matches.map((m) => `**${m.
|
|
108
|
+
const text = matches.map((m) => `**${m.topic}** \u2014 ${m.url}`).join("\n");
|
|
110
109
|
return { content: [{ type: "text", text }] };
|
|
111
110
|
}
|
|
112
111
|
);
|