Skip to main content
Glama
MissionSquad

@missionsquad/mcp-rss

Official

extract_feed_content

Extract and format RSS feed content into markdown, text, HTML, or JSON. Include metadata for enhanced context and streamline feed data integration.

Instructions

Extract and format feed content for different use cases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format for the contenttext
includeMetadataNoIf 'true', include item metadata (date, author, etc) in outputfalse
urlYesThe RSS feed URL to extract content from

Implementation Reference

  • Execute handler for 'extract_feed_content' tool: fetches RSS feed from cache or network, formats each item's content in the requested format (markdown, html, text, json) with optional metadata, and returns structured JSON output.
      execute: async (args, context) => {
        logger.info(
          `Extracting content from: ${args.url} (format: ${args.format})`
        );
    
        // Fetch feed
        let feed: FeedResult | null = feedCache.get(args.url);
        if (!feed) {
          feed = await rssReader.fetchFeed(args.url);
          feedCache.set(args.url, feed);
        }
    
        // Format content based on requested format
        const formatItem = (item: FeedItem): string | object => {
          const content = item.content || item.description || "";
          const metadata = {
            title: item.title,
            author: item.author,
            published: item.published
              ? new Date(item.published).toISOString()
              : null,
            url: item.url,
            categories: item.categories,
          };
    
          if (args.format === "json") {
            return args.includeMetadata === 'true' ? { ...metadata, content } : { content };
          }
    
          const metadataText = args.includeMetadata === 'true'
            ? [
                item.title ? `Title: ${item.title}` : "",
                item.author ? `Author: ${item.author}` : "",
                item.published
                  ? `Published: ${new Date(item.published).toISOString()}`
                  : "",
                item.url ? `URL: ${item.url}` : "",
                item.categories.length > 0
                  ? `Categories: ${item.categories.join(", ")}`
                  : "",
              ]
                .filter(Boolean)
                .join("\n")
            : "";
    
          switch (args.format) {
            case "markdown":
              const parts = [];
              if (item.title) parts.push(`# ${item.title}`);
              if (metadataText) parts.push(metadataText);
              if (content) parts.push(content);
              if (item.url) parts.push(`\n[Read more](${item.url})`);
              return parts.join("\n\n");
    
            case "html":
              const htmlParts = [];
              if (item.title) htmlParts.push(`<h1>${item.title}</h1>`);
              if (metadataText)
                htmlParts.push(
                  `<div class="metadata">${metadataText.replace(
                    /\n/g,
                    "<br>"
                  )}</div>`
                );
              if (content) htmlParts.push(`<div class="content">${content}</div>`);
              if (item.url)
                htmlParts.push(`<p><a href="${item.url}">Read more</a></p>`);
              return htmlParts.join("\n");
    
            case "text":
            default:
              const textParts = [];
              if (item.title) textParts.push(item.title);
              if (metadataText) textParts.push(metadataText);
              if (content) textParts.push(content);
              return textParts.join("\n\n");
          }
        };
    
        const formattedItems = feed.items.map(formatItem);
    
        const output = {
          feedTitle: feed.info.title,
          feedUrl: args.url,
          itemCount: feed.items.length,
          format: args.format,
          extractedAt: Date.now(),
          extractedAtISO: new Date().toISOString(),
          content: formattedItems,
        };
    
        logger.info(`Extracted content from ${feed.items.length} items`);
        return JSON.stringify(output, null, 2);
      },
    });
  • Zod schema defining input parameters for the extract_feed_content tool: url (required), format (optional enum), includeMetadata (optional boolean as string).
    const ExtractFeedContentSchema = z.object({
      url: z.string().describe("The RSS feed URL to extract content from"),
      format: z
        .enum(["markdown", "text", "html", "json"])
        .optional()
        .default("text")
        .describe("Output format for the content"),
      includeMetadata: z
        .string()
        .optional()
        .default("false")
        .describe("If 'true', include item metadata (date, author, etc) in output"),
    });
  • src/index.ts:342-440 (registration)
    Registration of the 'extract_feed_content' tool using server.addTool, specifying name, description, parameters schema, and execute handler.
    server.addTool({
      name: "extract_feed_content",
      description: "Extract and format feed content for different use cases",
      parameters: ExtractFeedContentSchema,
      execute: async (args, context) => {
        logger.info(
          `Extracting content from: ${args.url} (format: ${args.format})`
        );
    
        // Fetch feed
        let feed: FeedResult | null = feedCache.get(args.url);
        if (!feed) {
          feed = await rssReader.fetchFeed(args.url);
          feedCache.set(args.url, feed);
        }
    
        // Format content based on requested format
        const formatItem = (item: FeedItem): string | object => {
          const content = item.content || item.description || "";
          const metadata = {
            title: item.title,
            author: item.author,
            published: item.published
              ? new Date(item.published).toISOString()
              : null,
            url: item.url,
            categories: item.categories,
          };
    
          if (args.format === "json") {
            return args.includeMetadata === 'true' ? { ...metadata, content } : { content };
          }
    
          const metadataText = args.includeMetadata === 'true'
            ? [
                item.title ? `Title: ${item.title}` : "",
                item.author ? `Author: ${item.author}` : "",
                item.published
                  ? `Published: ${new Date(item.published).toISOString()}`
                  : "",
                item.url ? `URL: ${item.url}` : "",
                item.categories.length > 0
                  ? `Categories: ${item.categories.join(", ")}`
                  : "",
              ]
                .filter(Boolean)
                .join("\n")
            : "";
    
          switch (args.format) {
            case "markdown":
              const parts = [];
              if (item.title) parts.push(`# ${item.title}`);
              if (metadataText) parts.push(metadataText);
              if (content) parts.push(content);
              if (item.url) parts.push(`\n[Read more](${item.url})`);
              return parts.join("\n\n");
    
            case "html":
              const htmlParts = [];
              if (item.title) htmlParts.push(`<h1>${item.title}</h1>`);
              if (metadataText)
                htmlParts.push(
                  `<div class="metadata">${metadataText.replace(
                    /\n/g,
                    "<br>"
                  )}</div>`
                );
              if (content) htmlParts.push(`<div class="content">${content}</div>`);
              if (item.url)
                htmlParts.push(`<p><a href="${item.url}">Read more</a></p>`);
              return htmlParts.join("\n");
    
            case "text":
            default:
              const textParts = [];
              if (item.title) textParts.push(item.title);
              if (metadataText) textParts.push(metadataText);
              if (content) textParts.push(content);
              return textParts.join("\n\n");
          }
        };
    
        const formattedItems = feed.items.map(formatItem);
    
        const output = {
          feedTitle: feed.info.title,
          feedUrl: args.url,
          itemCount: feed.items.length,
          format: args.format,
          extractedAt: Date.now(),
          extractedAtISO: new Date().toISOString(),
          content: formattedItems,
        };
    
        logger.info(`Extracted content from ${feed.items.length} items`);
        return JSON.stringify(output, null, 2);
      },
    });
  • TypeScript interface defining the input parameters for extract_feed_content, matching the Zod schema.
    export interface ExtractFeedContentParams {
      url: string;
      format?: 'markdown' | 'text' | 'html' | 'json';
      includeMetadata?: 'true' | 'false';
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'extract and format' but doesn't disclose behavioral traits such as whether it's a read-only operation, potential rate limits, authentication needs, or what happens if the URL is invalid. This leaves critical operational details unspecified for a tool that processes external feeds.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. However, it could be more front-loaded with key details like the resource type (RSS feed) from the schema, but it's appropriately sized for its content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (processing external feeds with formatting options), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'extract' entails, the output structure, or error handling, making it inadequate for an agent to use effectively without guessing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents parameters like 'url', 'format', and 'includeMetadata'. The description adds no additional meaning beyond the schema, such as examples or edge cases. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Extract and format feed content' which provides a clear verb ('extract and format') and resource ('feed content'), but it's vague about what 'extract' entails compared to siblings like 'fetch_rss_feed' or 'get_feed_headlines'. It doesn't specify whether it extracts full articles, summaries, or specific fields, making it less distinct from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'for different use cases', which implies context but doesn't specify when to use this tool versus siblings like 'fetch_multiple_feeds' or 'search_feed_items'. There's no explicit guidance on scenarios, prerequisites, or exclusions, leaving the agent with minimal direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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