markContentSeen
Mark content items as seen after posting to track viewed YouTube videos, blog posts, and GitHub releases across sessions.
Instructions
Mark a content item as seen AFTER posting.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| type | Yes |
Implementation Reference
- src/server.ts:181-192 (registration)Registration of the 'markContentSeen' tool, including name, description, input schema, and inline execute handler that calls the markSeen helper.server.addTool({ name: "markContentSeen", description: "Mark a content item as seen AFTER posting.", parameters: z.object({ id: z.string(), type: z.enum(["youtube", "blog", "release"]), }), execute: async ({ id, type }) => { await markSeen(type, id); return JSON.stringify({ success: true }); }, });
- src/server.ts:188-191 (handler)Inline handler function for the tool that marks the content as seen using the markSeen helper and returns success.execute: async ({ id, type }) => { await markSeen(type, id); return JSON.stringify({ success: true }); },
- src/server.ts:184-187 (schema)Zod schema defining input parameters: id (string) and type (enum: youtube, blog, release).parameters: z.object({ id: z.string(), type: z.enum(["youtube", "blog", "release"]), }),
- src/server.ts:60-65 (helper)Helper function that loads last_seen.json, adds the id to the seen list for the given type if not already present, and saves the file.async function markSeen(type: string, id: string) { const data = await loadLastSeen(); if (!data.seen[type]) data.seen[type] = []; if (!data.seen[type].includes(id)) data.seen[type].push(id); await saveLastSeen(data); }
- src/server.ts:42-49 (helper)Helper to load the last_seen.json file, returning default empty seen lists if missing or invalid.async function loadLastSeen() { try { const raw = await fs.readFile(LAST_SEEN_FILE, "utf-8"); return JSON.parse(raw); } catch { return { seen: { youtube: [], blog: [], release: [] } }; } }