Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix(mcp): coerce null htmlContent before turndown in get-bookmark-content (#2915)

Joe Stump1ebf5b08f506
diff --git a/apps/mcp/src/bookmarks.ts b/apps/mcp/src/bookmarks.ts
index 15e4cf0e..a88d6617 100644
--- a/apps/mcp/src/bookmarks.ts
+++ b/apps/mcp/src/bookmarks.ts
@@ -247,7 +247,7 @@ mcpServer.tool(
let content;
if (res.data.content.type === "link") {
const htmlContent = res.data.content.htmlContent;
- content = turndownService.turndown(htmlContent);
+ content = turndownService.turndown(htmlContent ?? "");
} else if (res.data.content.type === "text") {
content = res.data.content.text;
} else if (res.data.content.type === "asset") {