Skip to main content
Glama
MissionSquad

@missionsquad/mcp-rss

Official

monitor_feed_updates

Track new items in an RSS feed by specifying a URL and checking updates since a specific time or the last fetch, ensuring timely content monitoring.

Instructions

Check for new items in a feed since a specific time or last check

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceYesTime reference for checking updates
urlYesThe RSS feed URL to monitor

Implementation Reference

  • The execute handler function that fetches the RSS feed, computes the 'since' timestamp, filters for new items based on publish/update dates, updates the cache, and returns a structured response with new items and metadata.
    execute: async (args, context) => {
      logger.info(`Monitoring updates for: ${args.url} since ${args.since}`);
    
      // Get current feed state
      const currentFeed = await rssReader.fetchFeed(args.url);
    
      let sinceTimestamp: number;
    
      if (args.since === "last") {
        // Get last fetch time from cache
        const cached = feedCache.get(args.url);
        if (cached) {
          sinceTimestamp = cached.fetchedAt;
        } else {
          // If no cache, return all items as new
          sinceTimestamp = 0;
        }
      } else {
        sinceTimestamp = args.since;
      }
    
      // Filter items newer than timestamp
      const newItems = currentFeed.items.filter((item) => {
        const itemTime = item.published || item.updated || 0;
        return itemTime > sinceTimestamp;
      });
    
      // Update cache
      feedCache.set(args.url, currentFeed);
    
      logger.info(
        `Found ${newItems.length} new items since ${new Date(
          sinceTimestamp
        ).toISOString()}`
      );
    
      return JSON.stringify(
        {
          feedUrl: args.url,
          feedTitle: currentFeed.info.title,
          since: sinceTimestamp,
          sinceISO: new Date(sinceTimestamp).toISOString(),
          checkedAt: currentFeed.fetchedAt,
          checkedAtISO: new Date(currentFeed.fetchedAt).toISOString(),
          newItemsCount: newItems.length,
          totalItemsCount: currentFeed.items.length,
          newItems,
        },
        null,
        2
      );
    },
  • Zod schema defining input parameters: url (string) and since (number timestamp or 'last').
    const MonitorFeedUpdatesSchema = z.object({
      url: z.string().describe("The RSS feed URL to monitor"),
      since: z
        .union([
          z.number().describe("Timestamp in milliseconds to check updates since"),
          z.literal("last").describe("Check updates since last fetch"),
        ])
        .describe("Time reference for checking updates"),
    });
  • src/index.ts:180-237 (registration)
    Registers the 'monitor_feed_updates' tool with the FastMCP server, specifying name, description, parameter schema, and execute handler.
    server.addTool({
      name: "monitor_feed_updates",
      description:
        "Check for new items in a feed since a specific time or last check",
      parameters: MonitorFeedUpdatesSchema,
      execute: async (args, context) => {
        logger.info(`Monitoring updates for: ${args.url} since ${args.since}`);
    
        // Get current feed state
        const currentFeed = await rssReader.fetchFeed(args.url);
    
        let sinceTimestamp: number;
    
        if (args.since === "last") {
          // Get last fetch time from cache
          const cached = feedCache.get(args.url);
          if (cached) {
            sinceTimestamp = cached.fetchedAt;
          } else {
            // If no cache, return all items as new
            sinceTimestamp = 0;
          }
        } else {
          sinceTimestamp = args.since;
        }
    
        // Filter items newer than timestamp
        const newItems = currentFeed.items.filter((item) => {
          const itemTime = item.published || item.updated || 0;
          return itemTime > sinceTimestamp;
        });
    
        // Update cache
        feedCache.set(args.url, currentFeed);
    
        logger.info(
          `Found ${newItems.length} new items since ${new Date(
            sinceTimestamp
          ).toISOString()}`
        );
    
        return JSON.stringify(
          {
            feedUrl: args.url,
            feedTitle: currentFeed.info.title,
            since: sinceTimestamp,
            sinceISO: new Date(sinceTimestamp).toISOString(),
            checkedAt: currentFeed.fetchedAt,
            checkedAtISO: new Date(currentFeed.fetchedAt).toISOString(),
            newItemsCount: newItems.length,
            totalItemsCount: currentFeed.items.length,
            newItems,
          },
          null,
          2
        );
      },
    });
  • TypeScript interface defining the tool's input parameters, matching the Zod schema.
    export interface MonitorFeedUpdatesParams {
      url: string;
      since: number | 'last';
    }
Install Server

Other Tools

Related Tools

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/MissionSquad/mcp-rss'

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