diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-04-27 02:05:09 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-04-27 02:07:50 +0000 |
| commit | 1568fe903d469ac4c6e6b978e96549f2c88ac6fd (patch) | |
| tree | 2577e65652c848d1b6907549550064cb3e6dc744 /apps/mcp | |
| parent | 1a24eb690803292286513404d27a0955d2b7ab44 (diff) | |
| download | karakeep-1568fe903d469ac4c6e6b978e96549f2c88ac6fd.tar.zst | |
fix(mcp): Fix spacing around the bookmarks
Diffstat (limited to 'apps/mcp')
| -rw-r--r-- | apps/mcp/package.json | 2 | ||||
| -rw-r--r-- | apps/mcp/src/bookmarks.ts | 2 | ||||
| -rw-r--r-- | apps/mcp/src/lists.ts | 6 | ||||
| -rw-r--r-- | apps/mcp/src/utils.ts | 27 |
4 files changed, 14 insertions, 23 deletions
diff --git a/apps/mcp/package.json b/apps/mcp/package.json index dfa38ed7..0229ea1d 100644 --- a/apps/mcp/package.json +++ b/apps/mcp/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@karakeep/mcp", - "version": "0.23.8", + "version": "0.23.9", "description": "MCP server for Karakeep", "license": "GNU Affero General Public License version 3", "type": "module", diff --git a/apps/mcp/src/bookmarks.ts b/apps/mcp/src/bookmarks.ts index 747bcd18..3b580e86 100644 --- a/apps/mcp/src/bookmarks.ts +++ b/apps/mcp/src/bookmarks.ts @@ -16,7 +16,7 @@ You can search bookmarks using specific qualifiers. is:fav finds favorited bookm is:archived searches archived bookmarks, is:tagged finds those with tags, is:inlist finds those in lists, and is:link, is:text, and is:media filter by bookmark type. url:<value> searches for URL substrings, #<tag> searches for bookmarks with a specific tag, -list:<name> searches for bookmarks in a specific list given its name, +list:<name> searches for bookmarks in a specific list given its name (without the icon), after:<date> finds bookmarks created on or after a date (YYYY-MM-DD), and before:<date> finds bookmarks created on or before a date (YYYY-MM-DD). If you need to pass names with spaces, you can quote them with double quotes. If you want to negate a qualifier, prefix it with a minus sign. ## Examples: diff --git a/apps/mcp/src/lists.ts b/apps/mcp/src/lists.ts index 242229cb..4180b3ee 100644 --- a/apps/mcp/src/lists.ts +++ b/apps/mcp/src/lists.ts @@ -18,9 +18,9 @@ mcpServer.tool( type: "text", text: res.data.lists .map( - (list) => ` -List ID: ${list.id} -Name: ${list.icon} ${list.name} + (list) => `List ID: ${list.id} +Name: ${list.name} +Icon: ${list.icon} Description: ${list.description ?? ""} Parent ID: ${list.parentId}`, ) diff --git a/apps/mcp/src/utils.ts b/apps/mcp/src/utils.ts index 6d7d8ad5..f34383ea 100644 --- a/apps/mcp/src/utils.ts +++ b/apps/mcp/src/utils.ts @@ -21,33 +21,25 @@ export function compactBookmark( ): string { let content: string; if (bookmark.content.type === "link") { - content = ` -Bookmark type: link -urk: ${bookmark.content.url} + content = `Bookmark type: link +Bookmarked URL: ${bookmark.content.url} description: ${bookmark.content.description ?? ""} author: ${bookmark.content.author ?? ""} publisher: ${bookmark.content.publisher ?? ""} `; } else if (bookmark.content.type === "text") { - content = ` - Bookmark type: text - Source URL: ${bookmark.content.sourceUrl ?? ""} -`; + content = `Bookmark type: text + Source URL: ${bookmark.content.sourceUrl ?? ""}`; } else if (bookmark.content.type === "asset") { - content = ` -Bookmark type: media + content = `Bookmark type: media Asset ID: ${bookmark.content.assetId} Asset type: ${bookmark.content.assetType} -Source URL: ${bookmark.content.sourceUrl ?? ""} -`; +Source URL: ${bookmark.content.sourceUrl ?? ""}`; } else { - content = ` -Bookmark type: unknown -`; + content = `Bookmark type: unknown`; } - return ` - Bookmark ID: ${bookmark.id} + return `Bookmark ID: ${bookmark.id} Created at: ${bookmark.createdAt} Title: ${ bookmark.title @@ -57,6 +49,5 @@ Bookmark type: unknown Summary: ${bookmark.summary ?? ""} Note: ${bookmark.note ?? ""} ${content} - Tags: ${bookmark.tags.map((t) => t.name).join(", ")} - `; + Tags: ${bookmark.tags.map((t) => t.name).join(", ")}`; } |
