Skip to main content
Glama

isNewContent

Check if content items from YouTube, blogs, or releases are new by tracking previously seen items across sessions to avoid duplicates.

Instructions

Return true if this content item has NOT been seen before.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
typeYes

Implementation Reference

  • The execute handler for isNewContent tool, which checks if the given content ID of a specific type has been seen before using hasSeen helper and returns { is_new: true/false }.
    execute: async ({ id, type }) => JSON.stringify({ is_new: !(await hasSeen(type, id)), }),
  • Zod input schema defining parameters: id (string) and type (enum: youtube/blog/release).
    parameters: z.object({ id: z.string(), type: z.enum(["youtube", "blog", "release"]), }),
  • src/server.ts:167-178 (registration)
    Registration of the isNewContent tool using 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)), }), });
  • Core helper function used by the handler to determine if a content ID of given type has been previously seen.
    async function hasSeen(type: string, id: string) { const data = await loadLastSeen(); return data.seen?.[type]?.includes(id); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EbonyLouis/content-fetcher-mcp2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server