aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/mcp/src/bookmarks.ts7
-rw-r--r--apps/mcp/src/lists.ts3
-rw-r--r--apps/web/app/api/v1/bookmarks/search/route.ts28
3 files changed, 26 insertions, 12 deletions
diff --git a/apps/mcp/src/bookmarks.ts b/apps/mcp/src/bookmarks.ts
index 14043489..57b6959b 100644
--- a/apps/mcp/src/bookmarks.ts
+++ b/apps/mcp/src/bookmarks.ts
@@ -36,6 +36,7 @@ machine learning is:fav`),
query: {
q: query,
limit: 10,
+ includeContent: false,
},
},
});
@@ -63,6 +64,9 @@ mcpServer.tool(
path: {
bookmarkId,
},
+ query: {
+ includeContent: false,
+ },
},
});
if (res.error) {
@@ -149,6 +153,9 @@ mcpServer.tool(
path: {
bookmarkId,
},
+ query: {
+ includeContent: true,
+ },
},
});
if (res.error) {
diff --git a/apps/mcp/src/lists.ts b/apps/mcp/src/lists.ts
index 1e0f3a8a..eee1cc96 100644
--- a/apps/mcp/src/lists.ts
+++ b/apps/mcp/src/lists.ts
@@ -33,6 +33,9 @@ mcpServer.tool(
path: {
listId,
},
+ query: {
+ includeContent: false,
+ },
},
});
if (res.error) {
diff --git a/apps/web/app/api/v1/bookmarks/search/route.ts b/apps/web/app/api/v1/bookmarks/search/route.ts
index f0c5417a..52081c7f 100644
--- a/apps/web/app/api/v1/bookmarks/search/route.ts
+++ b/apps/web/app/api/v1/bookmarks/search/route.ts
@@ -2,29 +2,33 @@ import { NextRequest } from "next/server";
import { z } from "zod";
import { buildHandler } from "../../utils/handler";
+import { zGetBookmarkSearchParamsSchema } from "../../utils/types";
export const dynamic = "force-dynamic";
export const GET = (req: NextRequest) =>
buildHandler({
req,
- searchParamsSchema: z.object({
- q: z.string(),
- limit: z.coerce.number().optional(),
- cursor: z
- .string()
- // Search cursor V1 is just a number
- .pipe(z.coerce.number())
- .transform((val) => {
- return { ver: 1 as const, offset: val };
- })
- .optional(),
- }),
+ searchParamsSchema: z
+ .object({
+ q: z.string(),
+ limit: z.coerce.number().optional(),
+ cursor: z
+ .string()
+ // Search cursor V1 is just a number
+ .pipe(z.coerce.number())
+ .transform((val) => {
+ return { ver: 1 as const, offset: val };
+ })
+ .optional(),
+ })
+ .and(zGetBookmarkSearchParamsSchema),
handler: async ({ api, searchParams }) => {
const bookmarks = await api.bookmarks.searchBookmarks({
text: searchParams.q,
cursor: searchParams.cursor,
limit: searchParams.limit,
+ includeContent: searchParams.includeContent,
});
return {
status: 200,