Skip to main content
Glama

search_feed_items

Search for specific content across multiple RSS feeds by querying titles, descriptions, or full content. Use this tool to filter and locate relevant feed items efficiently.

Instructions

Search for content across one or more RSS feeds

Input Schema

NameRequiredDescriptionDefault
feedsYesRSS feed URLs to search across
queryYesSearch query string
searchInNoWhich fields to search inall

Input Schema (JSON Schema)

{ "additionalProperties": false, "properties": { "feeds": { "description": "RSS feed URLs to search across", "items": { "type": "string" }, "type": "array" }, "query": { "description": "Search query string", "type": "string" }, "searchIn": { "default": "all", "description": "Which fields to search in", "enum": [ "title", "description", "content", "all" ], "type": "string" } }, "required": [ "feeds", "query" ], "type": "object" }

Implementation Reference

  • The execute handler function implementing the search_feed_items tool. It searches across specified RSS feeds for items matching the query in title, description, content, or all fields, using cache or fetching if needed.
    execute: async (args, context) => { logger.info(`Searching ${args.feeds.length} feeds for: "${args.query}"`); const searchResults: Array<{ feedUrl: string; feedTitle: string | null; item: FeedItem; matches: string[]; }> = []; // Fetch all feeds for (const feedUrl of args.feeds) { try { let feed: FeedResult | null = feedCache.get(feedUrl); if (!feed) { feed = await rssReader.fetchFeed(feedUrl); feedCache.set(feedUrl, feed); } // Search items const queryLower = args.query.toLowerCase(); for (const item of feed.items) { const matches: string[] = []; // Search in specified fields if (args.searchIn === "all" || args.searchIn === "title") { if (item.title?.toLowerCase().includes(queryLower)) { matches.push("title"); } } if (args.searchIn === "all" || args.searchIn === "description") { if (item.description?.toLowerCase().includes(queryLower)) { matches.push("description"); } } if (args.searchIn === "all" || args.searchIn === "content") { if (item.content?.toLowerCase().includes(queryLower)) { matches.push("content"); } } if (matches.length > 0) { searchResults.push({ feedUrl, feedTitle: feed.info.title, item, matches, }); } } } catch (error: any) { logger.error(`Failed to search feed ${feedUrl}: ${error.message}`); } } logger.info(`Found ${searchResults.length} matching items`); return JSON.stringify( { query: args.query, searchIn: args.searchIn, feedsSearched: args.feeds.length, totalMatches: searchResults.length, results: searchResults, }, null, 2 ); }, });
  • Zod schema defining input parameters for the search_feed_items tool: feeds (array of URLs), query (string), and optional searchIn field.
    const SearchFeedItemsSchema = z.object({ feeds: z.array(z.string()).describe("RSS feed URLs to search across"), query: z.string().describe("Search query string"), searchIn: z .enum(["title", "description", "content", "all"]) .optional() .default("all") .describe("Which fields to search in"), });
  • src/index.ts:250-325 (registration)
    Registration of the search_feed_items tool via server.addTool, specifying name, description, parameters schema, and execute handler.
    server.addTool({ name: "search_feed_items", description: "Search for content across one or more RSS feeds", parameters: SearchFeedItemsSchema, execute: async (args, context) => { logger.info(`Searching ${args.feeds.length} feeds for: "${args.query}"`); const searchResults: Array<{ feedUrl: string; feedTitle: string | null; item: FeedItem; matches: string[]; }> = []; // Fetch all feeds for (const feedUrl of args.feeds) { try { let feed: FeedResult | null = feedCache.get(feedUrl); if (!feed) { feed = await rssReader.fetchFeed(feedUrl); feedCache.set(feedUrl, feed); } // Search items const queryLower = args.query.toLowerCase(); for (const item of feed.items) { const matches: string[] = []; // Search in specified fields if (args.searchIn === "all" || args.searchIn === "title") { if (item.title?.toLowerCase().includes(queryLower)) { matches.push("title"); } } if (args.searchIn === "all" || args.searchIn === "description") { if (item.description?.toLowerCase().includes(queryLower)) { matches.push("description"); } } if (args.searchIn === "all" || args.searchIn === "content") { if (item.content?.toLowerCase().includes(queryLower)) { matches.push("content"); } } if (matches.length > 0) { searchResults.push({ feedUrl, feedTitle: feed.info.title, item, matches, }); } } } catch (error: any) { logger.error(`Failed to search feed ${feedUrl}: ${error.message}`); } } logger.info(`Found ${searchResults.length} matching items`); return JSON.stringify( { query: args.query, searchIn: args.searchIn, feedsSearched: args.feeds.length, totalMatches: searchResults.length, results: searchResults, }, null, 2 ); }, });
  • TypeScript interface defining the parameter types for search_feed_items tool, matching the Zod schema.
    export interface SearchFeedItemsParams { feeds: string[]; query: string; searchIn?: 'title' | 'description' | 'content' | 'all'; }

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