Skip to main content
Glama

get_swiss_news

Retrieve Swiss news headlines from SRF across categories like domestic, international, and economy. Returns articles with titles, descriptions, links, and publication dates.

Instructions

Get the latest Swiss news headlines from SRF (Schweizer Radio und Fernsehen). Returns top news articles with title, description, link, and publication date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoNews category. "switzerland" = domestic Swiss news (default), "international" = world news, "economy" = business & economy.
limitNoNumber of articles to return (default: 10, max: 50)

Implementation Reference

  • The main handler function for the get_swiss_news tool, which fetches and processes RSS news feeds from SRF.
    export async function handleGetSwissNews(args: {
      category?: string;
      limit?: number;
    }): Promise<string> {
      const category = args.category ?? "switzerland";
      const limit = Math.min(args.limit ?? 10, 50);
    
      const feedId = FEED_IDS[category];
      if (!feedId) {
        const valid = Object.keys(FEED_IDS).join(", ");
        throw new Error(`Unknown category "${category}". Valid categories: ${valid}`);
      }
    
      const xml = await fetchFeed(feedId);
      const allItems = parseRssItems(xml);
      const items = allItems.slice(0, limit);
    
      const result = {
        category,
        count: items.length,
        total_available: allItems.length,
        articles: items,
        source: "srf.ch",
      };
    
      const json = JSON.stringify(result, null, 2);
      if (json.length > 49000) {
        // Truncate descriptions if needed
  • Tool definition and registration block for get_swiss_news, including its description and input schema.
    {
      name: "get_swiss_news",
      description:
        "Get the latest Swiss news headlines from SRF (Schweizer Radio und Fernsehen). Returns top news articles with title, description, link, and publication date.",
      inputSchema: {
        type: "object" as const,
        properties: {
          category: {
            type: "string",
            enum: ["switzerland", "international", "economy"],
            description:
              'News category. "switzerland" = domestic Swiss news (default), "international" = world news, "economy" = business & economy.',
          },
          limit: {
            type: "number",
  • Switch case handling the invocation of get_swiss_news.
    case "get_swiss_news":
      return handleGetSwissNews(args as { category?: "switzerland" | "international" | "economy"; limit?: number });

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/vikramgorla/mcp-swiss'

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