fetchYoutube
Retrieve all YouTube videos from the Goose channel to monitor and track content updates across sessions for content management purposes.
Instructions
Fetch ALL YouTube videos from the Goose channel.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:70-82 (handler)The handler function that fetches all YouTube videos from the specified Goose channel using RSS parser and maps them to ContentItem objects.async function fetchYoutube(): Promise<ContentItem[]> { const feed = await rssParser.parseURL( `https://www.youtube.com/feeds/videos.xml?channel_id=${YOUTUBE_CHANNEL_ID}` ); return feed.items.map((item) => ({ id: item.id || item.link || "", title: item.title || "", url: item.link || "", published_at: item.pubDate || "", type: "video" as const, })); }
- src/server.ts:133-138 (registration)Registers the 'fetchYoutube' tool with FastMCP server, using empty Zod schema for parameters and execute handler that stringifies the result.server.addTool({ name: "fetchYoutube", description: "Fetch ALL YouTube videos from the Goose channel.", parameters: z.object({}), execute: async () => JSON.stringify(await fetchYoutube()), });
- src/server.ts:30-36 (schema)Type definition for ContentItem used as return type for fetchYoutube, defining the structure of fetched content.interface ContentItem { id: string; title: string; url: string; published_at: string; type: "video" | "blog" | "release"; }
- src/server.ts:136-136 (schema)Zod input schema for the tool, which takes no parameters.parameters: z.object({}),