Skip to main content
Glama
olibuijr

Iceland News MCP Server

by olibuijr

check_feeds

Verify RSS feed health and availability for debugging and monitoring Icelandic news sources across multiple languages and categories.

Instructions

Check the health and availability of RSS feeds. Useful for debugging and monitoring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourcesNoSpecific sources to check. If not specified, checks all sources.
timeoutNoTimeout in milliseconds for each feed check (1000-30000)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultsYes
checkedAtYes
totalFeedsYes
failedFeedsYes
healthyFeedsYes

Implementation Reference

  • The handler function for 'check_feeds' tool. Loops through sources and feeds, attempts to fetch a small number of news items using fetchNews (without cache), with per-feed timeout using AbortController. Collects success/failure stats including item count, response time, and errors. Returns markdown summary and structured FeedHealth data.
    async ({ sources, timeout }) => {
      const checkedAt = new Date().toISOString();
      const sourcesToCheck = sources && sources.length > 0
        ? sources.filter(s => s in SOURCES) as SourceName[]
        : (Object.keys(SOURCES) as SourceName[]);
    
      const results: Array<{
        source: string;
        sourceName: string;
        feed: string;
        feedDescription: string;
        status: "healthy" | "failed";
        itemCount?: number;
        error?: string;
        responseTimeMs?: number;
      }> = [];
    
      for (const source of sourcesToCheck) {
        const sourceInfo = SOURCES[source];
    
        for (const [feedKey, feedInfo] of Object.entries(sourceInfo.feeds)) {
          const startTime = Date.now();
    
          try {
            // Use AbortController for timeout
            const controller = new AbortController();
            const timeoutId = setTimeout(() => controller.abort(), timeout);
    
            const response = await fetchNews(source, feedKey, 5, false);
            clearTimeout(timeoutId);
    
            results.push({
              source,
              sourceName: sourceInfo.name,
              feed: feedKey,
              feedDescription: feedInfo.description,
              status: "healthy",
              itemCount: response.count,
              responseTimeMs: Date.now() - startTime,
            });
          } catch (error) {
            results.push({
              source,
              sourceName: sourceInfo.name,
              feed: feedKey,
              feedDescription: feedInfo.description,
              status: "failed",
              error: error instanceof Error ? error.message : String(error),
              responseTimeMs: Date.now() - startTime,
            });
          }
        }
      }
    
      const healthyFeeds = results.filter(r => r.status === "healthy").length;
      const failedFeeds = results.filter(r => r.status === "failed").length;
    
      const healthResult = {
        checkedAt,
        totalFeeds: results.length,
        healthyFeeds,
        failedFeeds,
        results,
      };
    
      // Format as markdown
      let markdown = `# Feed Health Check\n\n`;
      markdown += `*Checked at ${checkedAt}*\n\n`;
      markdown += `| Status | Count |\n|--------|-------|\n`;
      markdown += `| ✅ Healthy | ${healthyFeeds} |\n`;
      markdown += `| ❌ Failed | ${failedFeeds} |\n`;
      markdown += `| Total | ${results.length} |\n\n`;
    
      if (failedFeeds > 0) {
        markdown += `## Failed Feeds\n\n`;
        for (const result of results.filter(r => r.status === "failed")) {
          markdown += `- **${result.sourceName}** / ${result.feedDescription}: ${result.error}\n`;
        }
        markdown += "\n";
      }
    
      markdown += `## All Results\n\n`;
      markdown += `| Source | Feed | Status | Items | Time (ms) |\n|--------|------|--------|-------|------------|\n`;
      for (const result of results) {
        const status = result.status === "healthy" ? "✅" : "❌";
        const items = result.itemCount ?? "-";
        const time = result.responseTimeMs ?? "-";
        markdown += `| ${result.sourceName} | ${result.feed} | ${status} | ${items} | ${time} |\n`;
      }
    
      return {
        content: [{ type: "text" as const, text: markdown }],
        structuredContent: healthResult,
      };
    }
  • Zod schema defining the structured output for the check_feeds tool, including overall stats and per-feed health results.
    const FeedHealthSchema = z.object({
      checkedAt: z.string(),
      totalFeeds: z.number(),
      healthyFeeds: z.number(),
      failedFeeds: z.number(),
      results: z.array(z.object({
        source: z.string(),
        sourceName: z.string(),
        feed: z.string(),
        feedDescription: z.string(),
        status: z.enum(["healthy", "failed"]),
        itemCount: z.number().optional(),
        error: z.string().optional(),
        responseTimeMs: z.number().optional(),
      })),
    });
  • src/index.ts:875-892 (registration)
    MCP server registration of the 'check_feeds' tool, specifying description, input schema (sources array optional, timeout default 10s), and output schema.
    server.registerTool(
      "check_feeds",
      {
        description: "Check the health and availability of RSS feeds. Useful for debugging and monitoring.",
        inputSchema: {
          sources: z
            .array(z.string())
            .optional()
            .describe("Specific sources to check. If not specified, checks all sources."),
          timeout: z
            .number()
            .min(1000)
            .max(30000)
            .default(10000)
            .describe("Timeout in milliseconds for each feed check (1000-30000)"),
        },
        outputSchema: FeedHealthSchema,
      },
  • Key helper function called by check_feeds to test each feed by fetching 5 recent items (cache bypassed). Handles RSS parsing, error throwing for invalid feeds, and returns NewsResponse.
    async function fetchNews(
      source: SourceName,
      feed: string,
      limit: number = 10,
      useCache: boolean = true
    ): Promise<NewsResponse> {
      const sourceInfo = SOURCES[source];
      const feedInfo = sourceInfo.feeds[feed];
    
      if (!feedInfo) {
        throw new Error(`Unknown feed "${feed}" for source "${source}"`);
      }
    
      // Check cache first (cache stores max items, we slice later)
      if (useCache) {
        const cached = getFromCache(source, feed);
        if (cached) {
          // Return cached data with limit applied
          return {
            ...cached,
            count: Math.min(cached.items.length, limit),
            items: cached.items.slice(0, limit),
          };
        }
      }
    
      const result = await parser.parseURL(feedInfo.url);
      const fetchedAt = new Date().toISOString();
    
      // Fetch more items for cache (up to 50)
      const maxItems = 50;
      const items: NewsItem[] = result.items.slice(0, maxItems).map((item) => ({
        title: item.title || "No title",
        link: item.link || "",
        description: item.contentSnippet || item.content || "No description",
        pubDate: item.pubDate ? new Date(item.pubDate).toISOString() : fetchedAt,
        creator: (item["dc:creator"] as string | undefined) || null,
        source,
        sourceName: sourceInfo.name,
        feed,
        feedDescription: feedInfo.description,
      }));
    
      const fullResponse: NewsResponse = {
        source,
        sourceName: sourceInfo.name,
        feed,
        feedDescription: feedInfo.description,
        fetchedAt,
        count: items.length,
        items,
      };
    
      // Store full response in cache
      setCache(source, feed, fullResponse);
    
      // Return with requested limit
      return {
        ...fullResponse,
        count: Math.min(items.length, limit),
        items: items.slice(0, limit),
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool checks 'health and availability' but doesn't specify what that entails (e.g., HTTP status codes, response times, error details), whether it performs network requests, potential side effects like caching, or rate limits. The description adds minimal context beyond the basic purpose.

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 concise with two sentences: the first states the purpose, and the second provides usage context. It's front-loaded with the core functionality. However, the second sentence ('Useful for debugging and monitoring.') could be more integrated or specific to enhance clarity without adding waste.

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

Completeness3/5

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

Given the tool has an output schema (which handles return values), 2 parameters with full schema coverage, and no annotations, the description is minimally adequate. It covers the purpose and basic usage but lacks details on behavior, error handling, or integration with siblings. For a monitoring tool, more context on what 'health' entails would improve completeness.

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%, with clear descriptions for both parameters ('sources' and 'timeout'). The description doesn't add any parameter-specific semantics beyond what the schema provides (e.g., it doesn't explain what 'health' means in relation to 'sources' or how 'timeout' affects the check). Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Check the health and availability of RSS feeds' with specific verbs ('check', 'health', 'availability') and resources ('RSS feeds'). It distinguishes from siblings like 'get_news' or 'search_news' by focusing on monitoring rather than content retrieval. However, it doesn't explicitly differentiate from 'list_feeds', which might be a related listing operation.

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

Usage Guidelines3/5

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

The description provides implied usage context: 'Useful for debugging and monitoring.' This suggests when to use it (for health checks) but doesn't explicitly state when not to use it or name alternatives. For example, it doesn't clarify if this should be used instead of 'list_feeds' for availability checks or how it relates to 'get_news' for content access.

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

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/olibuijr/iceland-news-mcp'

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