isNewContent
Check if content items from YouTube, blogs, or releases are new by verifying they haven't been seen before, helping identify fresh content across sessions.
Instructions
Return true if this content item has NOT been seen before.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| type | Yes |
Implementation Reference
- src/server.ts:174-177 (handler)Handler logic for the 'isNewContent' tool: returns whether the content item (identified by id and type) is new by negating the result of hasSeen helper.execute: async ({ id, type }) => JSON.stringify({ is_new: !(await hasSeen(type, id)), }),
- src/server.ts:170-173 (schema)Zod input schema defining parameters 'id' (string) and 'type' (enum: youtube, blog, release) for the isNewContent tool.parameters: z.object({ id: z.string(), type: z.enum(["youtube", "blog", "release"]), }),
- src/server.ts:167-178 (registration)Registration of the 'isNewContent' tool via server.addTool, including name, description, schema, and handler.server.addTool({ name: "isNewContent", description: "Return true if this content item has NOT been seen before.", parameters: z.object({ id: z.string(), type: z.enum(["youtube", "blog", "release"]), }), execute: async ({ id, type }) => JSON.stringify({ is_new: !(await hasSeen(type, id)), }), });
- src/server.ts:55-58 (helper)Core helper function used by isNewContent handler to check if a specific content item (type, id) has been previously seen.async function hasSeen(type: string, id: string) { const data = await loadLastSeen(); return data.seen?.[type]?.includes(id); }